Query list of galleries — using as navigation

HomeSupportImage StoreQuery list of galleries — using as navigation

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #48526
    sarahfrantz
    Participant

    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…

    #48527
    sarahfrantz
    Participant

    Ok, well apparently listing my code isn’t working, but basically I queried the custom post type to get the permalink and title

    #48533
    Xpark Media
    Keymaster

    use 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

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.