Use Attributes in Titles & Meta

  • Hi,

    We like to use the attributes in the titles and meta but it looks like it does not work %category% %title% de %wc_brand% %pa_anos% where %pa_anos% is a attribute of woocommerce product

    Cheers

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 would not work since this is not a native Rank Math variable. To use it, you would need to register it on your site and add the necessary logic to get the value of the product attribute and display it when the custom variable is called.

    You can use the following filter to register the custom variable:

    add_action( 'rank_math/vars/register_extra_replacements', function() {
       RankMath\Helper::register_var_replacement( 'variable_name',array('Callback_name'),$args} );
    

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hi Michael,

    Thanks for the quick reply. Where must i put this or use this ?

    Cheers

    Hello,

    Thank you for contacting Rank Math today.

    The code should be added to your theme’s functions.php file but the snippet will not work in its current state. You will need to customize it further to get the current attributes from the product and display them.

    You may have to get in touch with your developer to help with this.

    Looking forward to helping you. Thank you.

    ​​​​​​

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘Use Attributes in Titles & Meta’ is closed to new replies.