Forums

How to set the # of gallery columns with one global setting? (4 posts)

  1. Michiel
    Member
    Posted 3 years ago #

    I'd like to set the number of columns for the gallery with one global setting as I like to keep things flexible in case I change my theme.

    I know I can use the code [gallery columns="4"] inside a post but I'd like to do this for all posts on my blog in one go...

    Is this possible somehow?

    Many thanks for your help!!

  2. Michiel
    Member
    Posted 3 years ago #

    I now figured out that I could do this using the following:
    <?php echo do_shortcode('[gallery columns="4"]'); ?>
    in my template index.php to set this globally for all galleries.

    The only question I still have is where in the index.php this code should be placed? I have been trying different places but seem to end up with two galleries per post, one with the default 3 columns and then one with the above 4 columns.

  3. Pete
    Member
    Posted 3 years ago #

    any luck with this?

  4. Michiel
    Member
    Posted 3 years ago #

    Not really....
    wish this forum would have a notification function...

Topic Closed

This topic has been closed to new replies.

About this Topic