Last active
September 9, 2024 08:59
-
-
Save carasmo/aab97746a466a5af5ae4ae563f60e6d4 to your computer and use it in GitHub Desktop.
Numbered Comment Pagination in Genesis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' => __( '« Older Comments', 'your-text-domain' ), | |
'next_text' => __( 'Newer Comments »', '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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!