• Hello,
    I Interested to buy WP-Paginate Pro Plugin
    does this plugin work with Post type or costom Wp Query
    //Example WP_Query
    $mycustom_query = new WP_Query( $args );

    I wass try in free version not work for custom query

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.
    Plugin Author AlanP57

    (@alanp57)

    No, if the free versions does not work with this code then the Pro would not be any different. Normally I would start with a blog index page that works with WP Paginate and then make modifications to the query. There are different ways to go about modifying the WordPress loop. Some may work better than others.

    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?

    Plugin Author AlanP57

    (@alanp57)

    I do not know. I’ve not done any research on using custom queries.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Post Type Custom WP_Query’ is closed to new replies.