Forums

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

  1. Michiel
    Member
    Posted 11 months 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 11 months 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. perthmetro
    Member
    Posted 10 months ago #

    any luck with this?

  4. Michiel
    Member
    Posted 10 months ago #

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

Reply

You must log in to post.

About this Topic