Custom Taxonomy Terms Archives titles by Custom Field

#491252
  • Resolved novoleg
    Rank Math free

    I have a custom post type and a custom taxonomy for it. For custom taxonomy, a custom field product_category_title was created using ACF. This is to display an alternate title as the Page Title for the taxonomy terms archives. But this %customfield(product_category_title)% construct doesn’t output anything.

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

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    This wouldn’t work as the %customfield(...)% variable can only extract the data from where the custom field is currently initiated, so the variable will only work on “business info” CPT.

    If you wish to retrieve the field from another page, you may need to use get_field function instead and attach it to a custom variable which you may refer to in this guide: https://rankmath.com/kb/variables-in-seo-title-description/#how-to-add-custom-variables

    get_field is an ACF function you can refer to this article for more information about it: https://www.advancedcustomfields.com/resources/get_field/

    Looking forward to helping you. Thank you.

    If you wish to retrieve the field from another page

    I’m not trying to get the value of a field from another page. My custom field is for my custom taxonomy terms themselves, not for the posts in them. And when I display the value of this field with a simple shortcode [acf field=”product_category_title”] on the term archive page, the field value is displayed correctly, respectively, the archive page has access to this field. I also need to display the value of this field in the title.
    Most likely, RankMath is simply not designed to work with custom fields specifically for terms of (custom) taxonomies. For posts only.

    Nigel
    Rank Math business

    Hello,

    Thank you for the clarification. the %customfield(...)% variable would not work for custom terms like in your situation. You will need to create a custom variable as stated in our previous reply.

    Hope that helps. Please let us know if you have questions.

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

You must be logged in to reply to this ticket.