WordPress.org

Ready to get started?Download WordPress

Forums

Genesis Featured Widget Amplified
[resolved] Pagination Not Working (6 posts)

  1. EricaMueller
    Member
    Posted 1 year ago #

    The site is here:
    http://chiptexas.org/

    Bottom of the front page, where we have two recent posts and pagination for the next. (We have 5 published posts)

    I have enabled pagination and told it to show. Checked both boxes. I have also enabled pagination in the Genesis Theme Settings.

    I've used this plugin a lot and never run into this issue.

    Please help!

    http://wordpress.org/extend/plugins/genesis-featured-widget-amplified/

  2. Nick the Geek
    Member
    Plugin Author

    Posted 1 year ago #

    what version of WordPress are you using?

  3. EricaMueller
    Member
    Posted 1 year ago #

    3.4

  4. Nick the Geek
    Member
    Plugin Author

    Posted 1 year ago #

    I believe that some changes to the way the query works is preventing my filter from allowing the pagination when there is a difference in the posts per page setting and the max posts per page in the Reading Settings with WP 3.4

    This means you will need to tell it about your query via the pre_get_posts filter in your functions.php to get the pagination to work right. Here is a really good tutorial on that
    http://www.billerickson.net/customize-the-wordpress-query/

  5. Travis Smith
    Member
    Posted 1 year ago #

    Try something like this in your functions.php. Assuming you have home-bottom as the instance custom field.

    add_action( 'pre_get_posts', 'wps_gfwa_posts_per_page' );
    function wps_gfwa_posts_per_page( $query ) {
    	if ( 'home-bottom' == get_query_var( 'gfwa' ) && ! is_admin() ) {
    		$query->set( 'posts_per_page', '4' ); // CHANGE ME!
    	}
    }
    
    add_filter( 'gfwa_query_args', 'wps_gfwa_query_args', 10, 2 );
    function wps_gfwa_query_args( $query_args, $instance ) {
    
    	$query_args['gfwa'] = $instance['custom_field'];
    
    	return $query_args;
    }

    Nick may want to add the wps_gfwa_query_args() as part of his plugin in the future.

  6. WebEndev
    Member
    Posted 1 year ago #

    The solution that Travis posted works great.

    Thanks much Travis!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic