Support » Theme: Travelify » Problems using wp-pagenavi and custom post types in Travelify

  • 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(
          '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?


  • The topic ‘Problems using wp-pagenavi and custom post types in Travelify’ is closed to new replies.