Forums

Different display depending on category (considered as pages for me) (3 posts)

  1. tomasi514
    Member
    Posted 1 year ago #

    HI guys,
    I am developping a website where pages are category pages: my menu links are category names.
    I want to display different content aspect depending on the category page where I am located. I know how to change sidebars (in the archive.php page) but I would like to find a way to control different <div id="content"> (I am using the default theme) depending on the category page.
    I read that I cannot duplicate archive.php page, I can make category-x.php pages, is it the solution for me ? If yes, what is the link with my display, or content ? I do not want to change numbers of posts or things like that but put for instance 3 colomns of content instead of one in the page, change width, background, etc (depending on category).
    Anyone who can help me ?

    ps ; wordpress rocks!

  2. moshu
    Member
    Posted 1 year ago #

    I can make category-x.php pages, is it the solution for me ?

    Yes > Category_Templates

    If yes, what is the link with my display, or content ?

    Don't worry about that part - WP is smarter than you'd ever think. It knows exactly when to use a template file and you should never ever link directly to any template file!
    You just click on a category name/link - and WP is using the proper template file according to the Template_Hierarchy.

  3. tomasi514
    Member
    Posted 1 year ago #

    Thank you moshu, I'll have a deeper look in that.

Topic Closed

This topic has been closed to new replies.

About this Topic