Hello,
Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.
Can you please further explain the goal in detail so we can provide a solution accordingly?
Could you please confirm if you are referring to the Woocommerce product attributes and insert its details to Rank Math’s meta as a variable?
You may share some examples in a form of screenshots and share them here so we can further help you with your concern.
Looking forward to helping you on this one.
For example, wine has a characteristic color.
Buy %Title% %atribut_color%
How to change the register? So that words become as a proposal?
Hello,
Unfortunately, Rank Math doesn’t have a variable to generate the product’s attribute details. However, you can create a custom variable and assign an attribute value.
Please try this filter and use the shortcode %shortcode_var_name%
:
add_action( 'rank_math/vars/register_extra_replacements', function(){
rank_math_register_var_replacement(
'shortcode_var_name', [
'name' => esc_html__( 'VAR name', 'rank-math' ),
'description' => esc_html__( 'VAR description', 'rank-math' ),
'variable' => 'shortcode_var_name',
'example' => shortcode_var_name_call_back(),
],
'shortcode_var_name_call_back'
);
});
function shortcode_var_name_call_back(){
return "YOUR COMMENT COUNT VALUE HERE";
}
Please note that this is just a placeholder code. You still need to modify this code to achieve the desired logic which is now out of our scope of support.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thanks, where I insert name of attribute?
Hello,
You would need to return the details of the attribute under the function shortcode_var_name_call_back
.
Here’s a thread that might guide you in retrieving the attribute value:
https://stackoverflow.com/a/13454788
Looking forward to helping you on this one.