The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Pagination Not Working - WP_Query with &Paged= (2 posts)

  1. brianfeister
    Posted 5 years ago #

    I've got a custom WP_Query being called as an array and I'm not sure how to call "&paged=" when it is contained in an array.

    Normally it would be:

    wp_query->query('showposts=10'.'&paged='.$paged .'cat=classes')

    But for some reason the same code when presented as an array is not working:

                    $current_date = date('ymd');
                    $recentEvents = new WP_Query();
                        'category_name' => 'classes',
                        'meta_key' => '_date_compare',
                        'meta_compare' => '>=',
                        'meta_value' => $current_date,
                        'orderby' => 'meta_value',
                        'order' => 'ASC',
    					'showposts' => 10,
    					'&paged' => $paged
                    if ($recentEvents->have_posts()) : while ($recentEvents->have_posts()) : $recentEvents->the_post(); ?>
  2. brianfeister
    Posted 5 years ago #

    This is the answer to my question, scrolling down, the original poster solves his own problem and that was my problem as well "custom_query_name" instead of "wp_query":


Topic Closed

This topic has been closed to new replies.

About this Topic