Extra theme hp issues with Meta description

#640248
  • Resolved Anonymous
    Rank Math free

    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;
    });

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math support.

    Yes, these codes should work without any issues. If you encounter any problem using them, please don’t hesitate to reach out to us, we’re always happy to help. You can learn more o how to add this code to your website here: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Thank you for choosing Rank Math

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Extra theme hp issues with Meta description’ is closed to new replies.