WordPress.org

Ready to get started?Download WordPress

Forums

get_category_ID (or something like it?) (2 posts)

  1. thornomad
    Member
    Posted 8 years ago #

    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

  2. niziol
    Member
    Posted 8 years ago #

    I've done this yet myself, but I think the Category Templates article might be able to help you out.

    Good luck,
    Michael.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.