• Resolved Bryan Cady

    (@bobcatou)


    The primary category no longer appears on posts. Just the category. Example here. https://ysnews.com/news/2013/11/creative-spark

    The coder used this PHP code to pull the primary category in the single.php file.

    <span class="slug"><?php $category = get_the_category(); echo end($category)->cat_name; ?></span>

    I’m not sure what the problem could be. Any tips are helpful.

    One thought I had was, is there a way to pull the primary category directly in the PHP code?

    Thanks
    Bryan

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey @bobcatou,

    Thank you for reaching out.

    While we can’t give any support on custom code or integration. However, I was able to find a GitHub gist that has some code related to getting the primary category set on a post. Hope this helps.

    • This reply was modified 3 years, 11 months ago by Jeroen Rotty. Reason: forgot to add the link

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Primary Category stopped displaying’ is closed to new replies.