Bring Your Business to Life › Support › Image Store › Query list of galleries — using as navigation
- AuthorPosts
- July 17, 2012 at 7:45 am #48526sarahfrantzParticipant
I’d like to list each gallery as a click-able link to that gallery. I tried querying just the post type, but it seems to not work properly… suggestions? This is my code
'ims_gallery',
'showposts' => '10');
$wp_query->query ($args);
?>have_posts() ) : $wp_query->the_post(); ?>
<a href="">It works great on any page that isn’t the gallery, but if I use that code in the sidebar on the actual gallery page, the gallery doesn’t show up…
July 17, 2012 at 7:46 am #48527sarahfrantzParticipantOk, well apparently listing my code isn’t working, but basically I queried the custom post type to get the permalink and title
July 17, 2012 at 9:35 pm #48533Xpark MediaKeymasteruse get post or create a custom loop using WP_Query();
$args = array( 'post_type' => 'page'); $galleries = new WP_Query( $args ); while ( $galleries->have_posts() ) : $galleries->the_post(); endwhile; // Reset Post Data wp_reset_postdata()
Here you can find more information on wp_query
- AuthorPosts
- You must be logged in to reply to this topic.