WordPress.org

Support

Support » How-To and Troubleshooting » get_category_ID (or something like it?)

get_category_ID (or something like it?)

  • Hi,

    I have created some “includes” — files that I want included on a couple of my various template files. I am trying to accomplish the following:

    I want my posts (not the whole look, just the post portion) to be formatted differently depending on their category. Different font, paragraph style, etc.

    I have diifernt CSS for each of my three categories.

    I am looking for something like:

    <?php include(TEMPLATEPATH . '/post-style-1.php'); ?>

    I suppose I could create a bunch of if/else statements, but what I wanted (since my files are numbered by category) was some sort of function from wordpress that will automatically determine the category of the post … so I can have it be just:

    'post-style-'$cat'.php' or 'post-style-'wp_get_category_ID()'.php'

    I know it can be done, I just can’t figure out how to write it.

    Thanks.

    Damon

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘get_category_ID (or something like it?)’ is closed to new replies.