|
/ Documentation /Developers Documentation/ Customize Homepage Pagination Format surerank_homepage_pagination_format

Customize Homepage Pagination Format surerank_homepage_pagination_format

Hook: surerank_homepage_pagination_format

Description: This filter customizes the formatted pagination suffix used in SureRank titles. The default format is “ – Page 2 of 5” (with the current page and total pages); it is not limited to the homepage.

Source: inc/functions/helper.php

Usage: Use this hook to change the formatted suffix. The callback receives the formatted string, current page, and total pages.

Example:

PHP
// Customize the pagination format on the homepage to display as "Page X"
add_filter( 'surerank_homepage_pagination_format', 'custom_homepage_pagination_format', 10, 3 );

function custom_homepage_pagination_format( $formatted, $page_num, $max_pages ) {
    return sprintf( ' - Page %d', $page_num );
}

You can add the example code to your child theme’s functions.php file or use a plugin like Code Snippets to safely insert custom code. Using a code snippet plugin is recommended for easier management and to ensure the code remains active even if you switch themes.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top