Primary Category

#847671
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    We apologize for the issue you are facing. To display the primary category on a single post, you can follow these steps:

    1. Set the Primary Category: When editing a post, you can set the primary category by selecting it in the Rank Math Meta Box. If you have multiple categories assigned to a post, you can choose which one should be the primary.

    2. Display the Primary Category: To display the primary category in your theme, you may need to modify your theme files. You can use the following code snippet in your theme’s single.php or wherever you want to display it:

      $primary_category = get_post_meta( get_the_ID(), '_rank_math_primary_category', true );
      if ( $primary_category ) {
         echo esc_html( $primary_category );
      }

      This code retrieves and displays the primary category for the current post.

    For more detailed instructions on how to choose a primary category, you can refer to this dedicated tutorial.

    If you have any further questions or need assistance, please feel free to reply to this ticket, and a human agent from the Rank Math Support team will assist you.

    Thank you for raising this concern!

    Sources:
    How to Enable Breadcrumbs on Your Website With Rank Math SEO » Rank Math

    Hello,

    Thank you for contacting us and bringing your concern to our attention.

    Please head over to your WordPress Dashboard > Rank Math > Titles & Meta > Posts/Products > Primary Taxonomy and from there select Categories:

    For more details, you can check this URL: https://rankmath.com/kb/how-to-choose-a-primary-category/

    Hope that helps and please don’t hesitate to let us know if you have any other questions.

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

The ticket ‘Primary Category’ is closed to new replies.