Primary category shortcode not working

#414810
  • Resolved Dmitrii Anikin
    Rank Math free

    I’m recreating my homepage based off an existing design and need help in figuring out: how to display only the primary category for posts via shortcode.

    I’ve followed the instructions here: https://support.rankmath.com/ticket/call-blog-primary-category/#post-279421 but it didn’t work.

    To summarize:
    – I added the PHP to my child theme (from the link above)
    – Inserted the shortcode inside a GenerateBlocks Headline Block, and set the Dynamic Data to the correct post, but it pulls both categories (WEDDING DRESSES, FASHION & BEAUTY).

    When I edit the block as HTML this is what I see:
    <div class=”gb-headline gb-headline-0607dfd6 gb-headline-text”>[rank-math-primary-category-shortcode]</div>

    Thanks!

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Could you please confirm if you have already selected the primary category on the page?

    If not yet, please set the primary taxonomy in Rank Math > Titles & Meta > [Post type] and set the primary term:
    https://rankmath.com/kb/how-to-choose-a-primary-category/

    Once done, clear your website’s cache and check again.

    Let us know how this goes.

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

The ticket ‘Primary category shortcode not working’ is closed to new replies.