get_the_content_feed with paginated posts

If you are talking about paginated posts which created using <!–nextpage–> tag, then you will have to use the_content_feed hook to strip that tag and pass the full content. I have tried below code & it does exactly that. But please note it will pass full content to RSS feed for all the posts. add_action(‘the_content_feed’, … Read more

Customizing comments pagination for bootstrap

Just replace that snippet for this one: <?php $pages = paginate_comments_links([‘echo’ => false, ‘type’ => ‘array’]); if( is_array( $pages ) ) { $output=””; foreach ($pages as $page) { $page = “\n<li>$page</li>\n”; if (strpos($page, ‘ current’) !== false) $page = str_replace([‘ current’, ‘<li>’], [”, ‘<li class=”active”>’], $page); $output .= $page; } ?> <nav aria-label=”Comment navigation”> <ul … Read more

Add css class to Pagination?

You can do what you are trying to do – add a CSS class selector to an HTML div tag, but you are mixing HTML and PHP code incorrectly. In order to do this correctly, you need to use the PHP opening/closing tags accordingly, such as: ?> <div class=”col-lg-12″> <?php echo paginate_links( array( ‘total’ => … Read more

Custom post type archive page pagination

Shouldn’t it be like this? ‘paged’ => (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1 And next_posts_link/previous_posts_links has these arguments: next_posts_link( $label , $max_pages ); $label is not a string in your code but a kind of an array? I am not so familiar with these “magical PHP functions”, but what do you suppose these “__” to do? … Read more

Can paginate_links() be customized for a specific category or tag?

The tag template page began displaying posts for specific tags once I replaced the argument statement with the following, which is great!!: $tags = get_the_tags(); $tag = $tags[0]->name; $args = array( ‘post_type’ => ‘post’, ‘post_status’=>’publish’, ‘category_name’ => ‘NEWS’, ‘tag_slug__and’ => $tag, ‘posts_per_page’ => 2, ‘paged’ => $paged ); However, when I click on a pagination … Read more

In pagination, change link for page 1 to homepage

You can do a simple str_replace( ‘/page/1/’, “https://wordpress.stackexchange.com/”, $string ) on the results generated by paginate_links() to get rid of /page/1/ which appears on the first page link as well as the Prev link (when it points to the first page). Here’s a full (tested) example: /** * Numeric pagination via WP core function paginate_links(). … Read more