• Hi Eric.

    I would like to know if you are planning to upgrade your plugin in order to make it fully functional with custom queries.

    I’m using it in a page where I have only one main custom loop and it doesn’t work. Simply it considers the main default query instead of mine so posts_per_page value that the paginate method uses is the default one.

    I’ve resolved adding an optional second parameter called $custom_query to the WP_Paginate function and to the paginate method. In case the var is passed I use the $custom_query->query_vars array to get right values.

    Let me know if this could be a permanent upgrade for your plugin.

    Bye.
    Simone

    https://www.ads-software.com/extend/plugins/wp-paginate/

Viewing 16 replies (of 16 total)
  • Code Themes

    (@codepixelzmedia)

    hi guys, I tried what has been posted here but it didn’t help. could you see through it.
    Here’s my code

    <?php
    		//wp_reset_query();
    		$current_page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    		$query = new WP_Query( 'category_name=news&posts_per_page=10&paged='.$current_page );
    		if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
     <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
     <?php comments_number( '0 comments', '1 response', '% responses' ); ?> | <?php the_time('M j Y') ?><br />
     Posted in: <?php
    $categories = get_the_category();
    $separator = ', ';
    $output = '';
    if($categories){
    	foreach($categories as $category) {
    		$output .= '<a href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '">'.$category->cat_name.'</a>'.$separator;
    	}
    echo trim($output, $separator);
    }
    ?>
      <?php the_excerpt();?>
      <hr />
     	<?php endwhile;
    	?>
    
        <?php
    	 else: ?>
    
    	<?php endif; ?>
    	<div class="navigation">
    			<?php if(function_exists('wp_paginate')) {
        wp_paginate(false,$query);
    } ?>

    The pagination does not show up

Viewing 16 replies (of 16 total)
  • The topic ‘WP-Paginate and custom queries’ is closed to new replies.