• Resolved andreas10407

    (@andreas10407)


    Hello everyone,

    I’m using illustratr theme (jetpack-plugin is running) with a self hosted wordpress and love it for the minimalist approach and clean output. But there is one problem for me:

    How can I change the width of a gallery in a single page?

    When I put a gallery in a portfolio-project, the gallery has a width of 1100px – that’s what I like to have (see example here: https://fleetingpix.net/portfolio/color/). But if I put a gallery in a single-page, the width is only 840px, what is to narrow for me (see example here: https://fleetingpix.net). I need 1100px for the design of my front-page, it should be consistent to the entire design of the website.

    I searched a few hours now for a solution. The hints in this forum didn’t worked for me (changing css-classes, adjust the content-width in the functions.php).

    Has anybody a solution for me?
    Thanks and regards, Andreas

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter andreas10407

    (@andreas10407)

    Problem is solved! I took a look at the core-files (content-portfolio-single.php) and found the solution. I put this php-snippet in the content-page.php:

    <?php// Access global variable directly to adjust the content width for single page
    if ( isset( $GLOBALS['content_width'] ) ) {
    	$GLOBALS['content_width'] = 1100;
    }
    ?>

    Then I changed in the custom-css the class “entry-content” from 840px to 1100px. Great on a large screen but bad for the smartphone-view. That’s why I modified the css, that it effects only large screens:

    @media screen and (min-width: 1220px) {
    	.entry-content {
    		width: 1100px;
    	}
    }

    It works nice and my problem is solved.
    Regards, Andreas

    Moderator Kathryn Presner

    (@zoonini)

    Thanks for sharing your solution, glad you’re set!

    Just a heads-up that if you didn’t already make a child theme, please be careful to make a backup of your files when you next update the theme, as all your changes will be overwritten.

    The best way to make changes to a theme is to use a child theme, so your tweaks won’t be lost when updating the theme. Here are some guides in case you haven’t made one before:

    https://codex.www.ads-software.com/Child_Themes
    https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/
    https://op111.net/53/
    https://vimeo.com/39023468

    Keeping your theme up-to-date is important so you’ll get all the latest bug and security fixes, as well as keep the theme compatible with the latest version of WordPress core.

    Thread Starter andreas10407

    (@andreas10407)

    Thanks for the advice.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing the width of galleries’ is closed to new replies.