|
/ Documentation /Developers Documentation/ Customize Post Type Archive Title Output surerank_post_type_archive_title

Customize Post Type Archive Title Output surerank_post_type_archive_title

Hook: surerank_post_type_archive_title

Description: This filter allows you to customize the archive title of any post type before it’s rendered on the frontend. It can be useful when you want to change the default title shown on post type archives, such as a registered Resources archive to a more user-friendly or SEO-optimized version.

Source: inc/frontend/title.php

Usage: This filter runs on post type archives only when automatic titles are enabled and surerank_enable_post_type_archive_auto_title returns true. Returning a fixed title affects every matching post type archive, so scope your callback to the intended archive.

Example:

PHP
// Change the archive title generated by SureRank for custom post types
add_filter( 'surerank_post_type_archive_title', 'custom_surerank_archive_title' );

function custom_surerank_archive_title( $title ) {
    return 'Our Latest Resources';
}

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