How to Display Taxonomy Term Title In php

#451652
  • Resolved Steav Brown
    Rank Math free

    Hello Sir,
    I have used to fetch taxonomy title to php file by code ” <?php $current_category_object = get_queried_object(); echo get_term_meta($current_category_object->term_id, ‘rank_math_title’, true); ?>”
    It display like

    %term% %sep% %sitename%

    in the file not like the title display on the titlebar.

    Can you please tell me how can I fix this issue ?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for reaching out to us and bringing your concern to our attention.

    You need to process the retrieved variables from the database. To do that, you need our replace_vars helper function. Please refer to this code instead:

    <?php
      $current_category_object = get_queried_object();
      $theMeta =  get_term_meta($current_category_object->term_id, 'rank_math_title', true);
    
      echo RankMath\Helper::replace_vars($theMeta);
    ?>

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Thank You So much… It’s working fine!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this ticket.