pagination custom post type on CP page

I’ve found the problem. Since I’m on a single (custom) post page, WP redirects back to the root of the URL. I’ve found the solution here. The solution (copied from the post on SO) was adding this to the functions.php: add_filter(‘redirect_canonical’,’pif_disable_redirect_canonical’); function pif_disable_redirect_canonical($redirect_url) { if( is_singular()) { $redirect_url = false; } return $redirect_url; } I’ve … Read more

How to check if post has previous_comments_link() and next_comments_link()

I should probably do <?php if( previous_comments_link() ) : ?> <li class=”previous”> <?php previous_comments_link( __( ‘&larr; Older Comments’, ” ) ); ?> </li> <?php endif; ?> <?php if( next_comments_link() ) : ?> <li class=”next”> <?php next_comments_link( __( ‘&larr; Newer Comments’, ” ) ); ?> </li> <?php endif; ?>

Paginated Comments “reply” does not work!

By the way, you don’t need the plug-in to break your comments into pages. This can be done by default, you have to chose and set some settings according to your needs though. You will find the according settings section under »Settings > Discussion > Other comment settings > “Break comments into pages..”« in your … Read more

Change template of WordPress comment-page

For comment pages, the WP_Query-var cpage is set, telling us which comment page we’re on, making it is possible to filter the content for comment pages like this: add_filter(‘the_content’, ‘comment_page_hide_content’); function comment_page_hide_content($content) { global $wp_query; if ($wp_query->get(‘cpage’) > 1){ // Greater than one, because 1 inducates the first comment page $content = “”; } return … Read more

paginate_comments_links() not working

paginate_comment_links() actually does some magic setup for comments and then calls the standard wordpress paginate_links(). I believe that part of that magic utilizes the result of wp_list_comments(). So even though your code is works great – you cannot use the built-in paginate comments functionallity because you are not using wp_list_comments(). And you can’t use that … Read more

return paginate_comments_links() as array

The first thing to say would be, you can’t say you haven’t been warned – see codex page paginate_comments_links(), section »Defaults«: These arguments are mostly to make the call of paginate_links() work, so be careful if you change them. It’s true, paginate_comments_links() is pretty much just a already customized version for comments of paginate_links(), with … Read more