Genesis Grid
[resolved] pagination not working with my custom template (4 posts)

  1. rowemore
    Posted 3 years ago #

    Hey Bill, love your work.

    I'm using the plugin, and using a custom template for my homepage, but the pagination is not working.

    The link at the bottom of the homepage "« Older Posts" appears, and allows the user to navigate to /blog/page/2/ ... but that page shows the same posts that appear on the homepage. How do I fix this so it shows older posts?

    my template looks like this:

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'eleven40_grid_loop_helper' );
    function eleven40_grid_loop_helper() {
    echo 'some html is in here';
    if ( function_exists( 'genesis_grid_loop' ) ) {
    		genesis_grid_loop( array(
    			'features' => 1,
    			'feature_image_size' => 1,
    			'feature_image_class' => 'post-image',
    			'feature_content_limit' => 250,
    			'grid_image_size'		=> 'full',
    			'grid_image_class'		=> 'post-image',
    			/*'grid_content_limit' => 250,*/
    			'more' => __('',FALSE,''),
    			'posts_per_page' => 1,
    		) );
    	} else {

    On a related note, I am using the plugin "advanced excerpts" ... and with the above template, the advanced excerpts show up for the grid_content but not for the feature_content ...

    any clue here? ... thank you so much, I'm clueless right now on how to fix both these things, been working on this for days. Cheers Bill!


  2. Bill Erickson
    Plugin Author

    Posted 3 years ago #

    The issue is that my plugin uses the standard loop ( genesis_do_loop() ), and you're unhooking that to use Genesis' grid loop.

    If you remove everything except genesis(); from that theme file, it should work.

  3. ashercharles
    Posted 3 years ago #

    I am having an issue, this is my code to pull in all posts from a custom post type and from the current category, I have tried every pagination fix I can find in 8 hours of searching but nothing will work. I have taken my code back to the original to show you my starting point.

    <?php $args = array_merge( array('posts_per_page' => '1', 'post_type' => 'coupons', 'category__in' => array(get_the_category('cat'))  ) );
    query_posts($args); ?>

    I couldn't figure out how to post a new topic so I have posted it here, I really hope someone can help.

    Link to site, username and password are 'test' http://squasha.com/tech/computers/

  4. Bill Erickson
    Plugin Author

    Posted 3 years ago #

    Never use query_posts. If you're trying to modify the main query on the page, use pre_get_posts (tutorial). If you're trying to display a secondary loop, use WP_Query (tutorial).

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Genesis Grid
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic