Viewing 3 replies - 1 through 3 (of 3 total)
  • Most themes should have this built in. If you:

    1) Log into WordPress
    2) Using the left-hand menu navigate to “Posts”
    3) Under the left-hand Posts click “Categories”
    4) Hover a category name and click “View”

    This will take you to the page where category posts are listed.

    If you want to add files to your custom theme ( if it’s not a custom theme, make a child theme ) then you can copy or duplicate index.php and rename it to category-{$your_category_slug_here}.php.

    For example, if I had category “Foo” the slug would be ‘foo’ and the template name would be: category-foo.php. You can view more templates by following this URL.

    To create CSS you could go to Appearance -> Editor -> style.css but be very careful here. Another method is to use FTP and navigate to your custom theme to append your CSS to style.css

    Thread Starter jimenagordillo

    (@jimenagordillo)

    I am using x-theme. i know how to get to the archive page where the category is… but i vant modify that page, change the menu, add a header, etc… thats whay i want to create one similiar… i have three blogs in my page. and y have the posts under different categories so can list them apart for each.

    Since you want to change the header and menu there’s a couple ways.

    Pure CSS – The <body> usually has a specialized class that only applies to that category. It’ll probably say category-123 or some number which is the category ID. This will let you change the existing header styles with something different. You can then save these in style.css or a similar file.

    Templatesget_header() accepts a string argument $name where you can retrieve a different header file. So you could create header-category.php where you change the information in the header and menus in the header. Then in your category template file you would that new header: get_header( 'category' );.

    Your best bet is to use CSS so you don’t confuse readers navigating your website. Hopefully that helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘css for category pages’ is closed to new replies.