WordPress.org

Forums

Travelify
Problems using wp-pagenavi and custom post types in Travelify (1 post)

  1. gutopontelo
    Member
    Posted 11 months ago #

    Hello!

    I'm using a child theme from Travelify.
    I activated the wp-pagenavi plugin and it's not working well.
    Its important to say that i'm using custom post types.
    In my custom function travelify_theloop_for_search() I put:

    if(get_query_var('paged')) {
      $paged = get_query_var('paged');
    } elseif(get_query_var('page')) {
      $paged = get_query_var('page');
    } else {
      $paged = 1;
    }
    
    $args = array(
      'post_type' => $colecao,  //passed by parameter
      'paged' => $paged,
      'meta_query' => array(
        array(
          'value' => $s,
          'compare' => 'LIKE',
          'posts_per_page' => 10
        )
      )
    );
    
    // get results
    $the_query = new WP_Query( $args );

    The navigation is showed but not working well. Sometimes got 404, extra pages, etc.
    Is there something more that i need to do?

    Thanks!

Reply

You must log in to post.

About this Theme

About this Topic