Reputation: 654
I'm Currently using the Wordpress Gallery Plugin, and it is working fine, but I want to List all the Galleries already created on one page.
The Gallery Plugin Shortcodes work fine, here is an example of one: [print_gllr id=43 display=short]
I can display that Shortcode using this: <?php echo do_shortcode('[print_gllr id=43 display=short]'); ?>
But, isn't there a way to Display all Shortcodes of print_gllr with display=short?
Thanks a lot in Advace.
Upvotes: 0
Views: 1379
Reputation: 654
Here it is:
<?php
$args = array( 'post_type' => 'gallery' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<?php echo do_shortcode('[print_gllr id='.get_the_ID().' display=short]'); ?>
<?php endwhile; ?>
It Will create a Loop with all the Galleries covers, so you can use it in a Page, to display'em All.
Upvotes: 1