Home Forums Front-end Issues Issues with Basic Gallery Reply To: Issues with Basic Gallery

  • Thanks for the continued help, much appreciated!

    I think I was able to get it working by altering the code to display the gallery in my template file. Instead of using:
    echo do_shortcode('[gallery orderby="menu_order" link="none" size="large" columns="1"]')

    I’m now using:

    <?php if ( '' !== ( $gallery = get_post_meta( get_the_ID(), 'project_gallery', true ) ) ) : ?>
                    <section class="project-gallery"> 
    		<?php echo do_shortcode( $gallery ); ?>
                <?php endif; ?>

    The ‘if’ statement was already wrapping my original code, I just wasn’t taking advantage of it properly. Someone else had started this plugin for us, and I was just trying to get it working (with my limited PHP knowledge).

    It now functions just like a gallery added to the main content area, so we do have to make sure all variables are accounted for there (e.g, link=none, size=large, etc.). But this is fine.