WordPress.org

Ready to get started?Download WordPress

Forums

Category attributes, just like Page attributes (5 posts)

  1. huangjb
    Member
    Posted 3 years ago #

    I hope in new release of wordpress, it will allow me to choose template and set order for a Category, just like I did for a Page.
    I think it is more gentler than that now using <?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?> to create a gallery Category.

  2. I hope in new release of wordpress, it will allow me to choose template and set order for a Category, just like I did for a Page.

    You could just make a template page for that category. category-slug.php will automatically format the category page for that cat.

    http://codex.wordpress.org/Category_Templates

  3. huangjb
    Member
    Posted 3 years ago #

    Ahh, That is great, thanks Ipstenu.

    But if I am a theme developper, I don't know the category slug and id when I am developping a theme.
    For example, a site may needs 2 news category, talking about different topic, but they need the same layout. Then I must copy the same template to category-news0.php and category-news1.php.

    Really don't understand why they make Page type different, and allow it choose template, why not category and post?

  4. But if I am a theme developper, I don't know the category slug and id when I am developping a theme.

    Thats a different matter. I would say use a theme setting type tool to assign templates to categories, but that's not my forte.

  5. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    WP 3.1 will introduce post_formats which might make this a little easier.

    Another option might be to build a them options page that allows users to assign category ids to specific pre-written category template files which can then be called via get_template_part.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.