WordPress.org

Ready to get started?Download WordPress

Forums

Sugar and Spice
[resolved] Page Template with Default Gallery (2 posts)

  1. PrfctGdess
    Member
    Posted 2 months ago #

    LOVE your theme! I'm interested, however, in defaulting back to the main gallery style of thumbnails in columns (instead of a full-size slideshow) on a few pages. I was thinking I'd add a page template with the gallery function calls. Could you point me in the right direction with the code? I'm wondering what files/code/function calls, etc your theme modifies or overwrites. TIA!!

  2. PrfctGdess
    Member
    Posted 2 months ago #

    OK, I figured this out (for anyone else wanting to do the same thing).

    1. create your new page template (in this case, I copied the Full Width Page Template and called it Photo Gallery Template)

    2. Add this code to the top of the page template, just after the get_header() call:

    <?php
       // Reset the filters to display the default gallery instead of the theme style galleries
       remove_filter( 'post_gallery', 'sugarspice_post_gallery' );
       add_filter( 'use_default_gallery_style', '__return_true' );
    ?>

    Hope that helps someone!

Reply

You must log in to post.

About this Theme

About this Topic