The Extra theme displays a “Related Posts” section on the single blog page at the bottom under author profile. If you’d like to change the text of “Related Posts” to something else (e.g. “Popular Posts”), you can do so with the following PHP code:
add_filter('gettext', 'dbeb_changeRelatedPostsText', 20, 5);
if (!function_exists('dbeb_changeRelatedPostsText')) {
function dbeb_changeRelatedPostsText($translation, $text, $domain ) {
if (is_single() && $domain === 'extra' && $text === 'Related Posts') {
return 'Popular Posts';
}
return $translation;
}
}
Just substitute “Popular Posts” with your desired text in the above code.
As this is PHP code, you can add it to the functions.php of a child theme, or using a plugin such as Code Snippets. Please take a backup prior to adding PHP code to your site, so that you can restore the original version if necessary.
I’d like to change excerpt length at my homepage (EXTRA theme). How to add more words to the excerpt or more letters (eg. 300) ?
Hi nIYAS, is there any chance you’re able to share a link (via the contact form if you like), or alternatively confirm which module you’re using on the home page. The method of changing the excerpt will depend on which module is in use… Thanks!