-
Hello,
I’m using elegant themes Extra theme and there seems to be a conflict in the way that theme handles homepage building. At any case, homepage title, meta description and canonical URL were not displaying. I found a solution via https://rankmath.com/kb/filters-hooks-api-developer/
and just want to make sure that this code in rank-math.php wont cause any issues Im not aware of. thank you for you time
add_filter('rank_math/frontend/description', function($description) {
if (is_home() || is_front_page()) {
// Replace 'Your Title' with your custom meta description
$description = 'Simplified how-to, tech insights, and app reviews. Discover our resources for learning and staying updated on the latest tech trends.';
}
return $description;
});add_filter('rank_math/frontend/title', function($title) {
if (is_home() || is_front_page()) {
// Replace 'Your Title' with your custom meta title
$title = 'D5 Tech News - Simplified tech insights and app reviews for trend updates.';
}
return $title;
});add_filter('rank_math/frontend/canonical', function($canonical) {
if (is_home() || is_front_page()) {
// Replace 'https://example.com' with your custom canonical URL
$canonical = 'https://d5technews.com';
}
return $canonical;
});
The ticket ‘Extra theme hp issues with Meta description’ is closed to new replies.