Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter khails

    (@khails)

    The code above works fine in most other paginations like WP-Pagenavi. I want this to work in this plugin too. or is there any other code to integrate with custom queries?

    Thread Starter khails

    (@khails)

    /* 
     * My Custom Query
     */
    
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; 
    $args = array(
      'post_type' => array('post'), 
      'post_status' => 'publish', 
      'order' => 'DESC', 
      'orderby' => 'date', 
      'posts_per_page' => 1, 
      'paged' => $paged, 
    );
    
    // WP_Query
    $mycustom_query = new WP_Query( $args );
    ?>

    This Not Work

    //not work for custom query
    <?php wp_paginate( array( ‘query’ => $mycustom_query ) ); ?>

    <?php
    $GLOBALS[‘wp_query’]->max_num_pages = $mycustom_query->max_num_pages;
    wp_paginate( array( ‘query’ => $mycustom_query )); ?>

    • This reply was modified 5 years, 2 months ago by khails.
    • This reply was modified 5 years, 2 months ago by khails.
Viewing 2 replies - 1 through 2 (of 2 total)