How to change this code?

#192227
  • Resolved MyNameis32
    Rank Math free

    In the sensitive data i wrote a code about yoast and related products.
    but the problem is that im using rank math, so i would like to get my code with rank math.
    In the sensitive data there is more information, thank you.

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    The selection of what goes into the related products is really something that is handled by WooCommerce or your theme depending on what features it has.

    Rank Math does not really have a specific feature for this.

    You might need to do your own modifications on your own to get this working as you want.

    Having said that, here’s an example code of how you can extract the primary category from a product to update the code you mentioned in the sensitive data section:

    
    $primary_cat_id = get_post_meta( $product->id, 'rank_math_primary_category', true );
    

    ​​​​​​Hope this helps find a solution for your request.

    Don’t hesitate to get in touch if you have any other questions.

    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 ‘How to change this code?’ is closed to new replies.