Skip to content

Instantly share code, notes, and snippets.

@carasmo
Last active September 9, 2024 08:59
Show Gist options
  • Save carasmo/aab97746a466a5af5ae4ae563f60e6d4 to your computer and use it in GitHub Desktop.
Save carasmo/aab97746a466a5af5ae4ae563f60e6d4 to your computer and use it in GitHub Desktop.
Numbered Comment Pagination in Genesis
<?php
//don't add again
add_action( 'genesis_comments', 'your_prefix_paginate_comments', 15 );
/**
* Paginate Comment Navigation
*/
function your_prefix_paginate_comments() {
echo '<div class="archive-pagination pagination">';
paginate_comments_links( array(
'prev_text' => __( '&laquo; Older Comments', 'your-text-domain' ),
'next_text' => __( 'Newer Comments &raquo;', 'your-text-domain' ),
) );
echo '</div>';
}
/**
* Filter original comment pagination so it doesn't display
* @thanks Gary Jones
*/
add_filter( 'genesis_markup_comments-pagination', '__return_empty_string' );
@Swagatam1975
Copy link

This code works perfectly, and replaces the existing "older comments", "newer comments" with numbered paginations.
I am extremely grateful to the creator of this code!
Thank You!

@carasmo
Copy link
Author

carasmo commented Sep 9, 2024

You're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment