StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   Removing 'Next Page' link from last page of blog (http://www.studiopress.com/support/showthread.php?t=121705)

Collins 10-22-2012 10:15 AM

Removing 'Next Page' link from last page of blog
 
Any idea on how to get rid of the 'Next Page' link on the last listings page: http://bit.ly/Rpj9G4? Since there are no more blog posts beyond that page, it takes you to a 404.

NicktheGeek 10-22-2012 10:58 AM

What is your posts per page setting in your reading settings? Are you changing the category or anything else for this?

Collins 10-22-2012 11:06 AM

"Blog pages show at most" is set to 30. I wonder if this has anything to do with it being used for Press Releases.

NicktheGeek 10-22-2012 11:11 AM

the problem is you have it set to show 30 posts per page but in that template it is only showing 10 posts per page.

Collins 10-22-2012 11:23 AM

As a test, in our development environment, I reduced it to 5 posts per page, but it didn't affect either the Blog page or the Press Releases page. Both still show 10 posts per page.

NicktheGeek 10-22-2012 12:18 PM

You appear to be using some kind of template file to change the query. It is using the grid loop output.

Collins 10-22-2012 12:29 PM

I think you're right. I wonder if the Press Releases template is count Blog posts.

Collins 10-22-2012 12:38 PM

Strange. I found the control in a custom template, which had posts_per_page set to 10. No matter what number I change that to, I get a 404 for page 6. Just for testing purposes, I changed it to 100 and didn't get the Next Page link on page 2, which is correct (but we need to have it at 10 per page).

Here's the template:

PHP Code:

<?php
remove_action
'genesis_loop''genesis_do_loop' );
add_action'genesis_loop''pnap_grid_loop_helper' );
/** Add support for Genesis Grid Loop **/
function pnap_grid_loop_helper() {
    if ( 
function_exists'genesis_grid_loop' ) ) {
        
genesis_grid_loop( array(
            
'features' => 1,
            
'loop' => 'custom',
            
//'feature_image_size' => 'grid-ftd-thumbnail',
            //'feature_image_class' => 'alignleft post-image',
            
'feature_content_limit' => 500,
            
//'grid_image_size' => 'grid-thumbnail',
            //'grid_image_class' => 'alignleft post-image',
            
'grid_content_limit' => 500,
            
'more' => __'Read More''genesis' ),
            
'posts_per_page' => 10,
            
'post_type' => 'pnap_press_release'
        
) );
    } else {
    
        
genesis_standard_loop();
    }
}
 
/** Remove the post meta function for front page only **/
remove_action'genesis_after_post_content''genesis_post_meta' );
 
genesis();


Collins 10-22-2012 01:12 PM

There are around 130 press releases. When I change the posts_per_page to 30, I don't get the Next Page link on the last page (page 5), which is correct. However, that doesn't resolve the issue, since that is too many per page. Any idea where to look?

NicktheGeek 10-22-2012 03:33 PM

you will need to use a function in the functions.php file to customize the posts_per_page in the query
http://billerickson.net/customize-the-wordpress-query/


All times are GMT -5. The time now is 07:08 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.