Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Similar posts

$
0
0

Replies: 0

Hi,

I’d like to change the similar post heading and title to something other than h2 and h3 as they are set by default since I believe that from an SEO perspective, they are receiving too much importance.
In the Kadence knowledge base I found the filter to change the tag for the similar posts heading:

/**
 * Change the similar posts title output.
 *
 * @param string $html the output html.
 */
function custom_similar_posts_title( $html ) {
    $html = '<h4 class="entry-related-title">' . esc_html__( 'Similar Posts', 'custom-text-domain' ) . '</h4>';
    return $html;
}
add_filter( 'kadence_single_post_similar_posts_title', 'custom_similar_posts_title' );

But if the heading becomes h4, the titles of the similar posts stay an h3 and so the hierarchy is broken. Do you also have a filter for changing the title of the similar posts (not only the heading)?

Thanks!


Viewing all articles
Browse latest Browse all 59525

Trending Articles