How to disable content pagination?

EDIT – Now that 4.4 is out, you should use the content_pagination filter. See birgire’s answer below. You can add formatting to raw post content by applying the content filters directly to $post->post_content: echo apply_filters( ‘the_content’, $post->post_content ); This will bypass pagination by not using the get_the_content function, which is what the_content uses internally to … Read more

Display all posts from all categories with pagination

To be able to order by category, you have to intercept the MySQL Query. Start with pre_get_posts: add_action(‘pre_get_posts’,’setup_my_query_interception’); function setup_my_query_interception($query){ if(!is_admin() && $query->is_home() && $query->is_main_query()){ add_filter( ‘posts_clauses’, ‘order_by_category_intercept_query_clauses’, 20, 1 ); } } Now we enhance the MySQL Query to include the term and taxonomy tables: function order_by_category_intercept_query_clauses($pieces){ global $wpdb; $pieces[‘join’].=” LEFT JOIN $wpdb->term_relationships trt … Read more

Reverse comment pagination numbers

i’ve used wp_list_comments like this: <?php if (class_exists(‘Walker_Comment_Wink’)) $walker = new Walker_Comment_Wink(); else $walker=””; wp_list_comments(array(‘walker’ => $walker, ‘type’ => ‘comment’ , ‘callback’ => ‘theme_comment2’)); ?> i used the plugin http://winkpress.com/articles/fix-reversed-comments-pagination/ to fix the “* and 1 comment” weirdness. You have the option to pass $reverse_top_level (boolean) (optional) Setting this to true will display the most … Read more

Implementing a general Table of Content across single paginated post pages

Just inspect the current post content for <!–nextpage–>: function wpse_check_multi_page() { $num_pages = substr_count( $GLOBALS[‘post’]->post_content, ‘<!–nextpage–>’ ) + 1; $current_page = get_query_var( ‘page’ ); return array ( $num_pages, $current_page ); } On page 2 of 3 that returns: Array ( [0] => 3 [1] => 2 ) On an unpaged post it returns: Array ( … Read more

Date based URLs for custom posts and pagination

Calling $GLOBALS[“wp_rewrite”]->flush_rules() did make everything work as I required but that wouldn’t be a good solution. Actually, you have to flush the rewrite rules after modifying them (i.e. also when registering custom post types). Also, you should never rely on these global variables. WordPress provides specific functions for nearly everything. For example, use flush_rewrite_rules() instead … Read more