WordPress.org

Ready to get started?Download WordPress

Forums

How to show what category a post is in. (1 post)

  1. easyrider
    Member
    Posted 6 years ago #

    I would like to make a special sidebar that appears only when the reader is looking at a post from a specific category.

    I can't figure out how to display the parent category id for a post.

    So I need to do do a if them statment to display they proper sidebar...

    If category 1 then display sidebar.php
    If category 2 then display sidebar2.php

    So how do I know what category a post is in and assign it to a variable?

Topic Closed

This topic has been closed to new replies.

About this Topic