Welcome, guest!

Feel free to read the blog, browse for themes, or join the club.

Style posts by category on home page

  1. With Carrington, I can create a cat-someCategory.php file, drop it in the content folder and display the given category's posts with its own unique style on my main home page - with other categories carrying their own styles.

    Is it possible to do this with Hybrid?

  2. You must be a logged-in exclusive member to view this reply.

  3. Style it differently. Running WP 2.7b3.

  4. You must be a logged-in exclusive member to view this reply.

  5. This is sick. Sick in the sense of slick. Many thanks!

  6. ...perhaps the wrong thread to post this on, but:

    re: http://www.mpcspeedskating.com

    Can I have posts filed under a specific category, display in single post view without the sidebar (ie. so that any post filed under the category WHEELS - a 'product' category - will display the full post at full width, no sidebar)?

    This would give these posts their own look, and a focus on the post content (since they're product-related) without the distraction of the sidebar when they're displayed.

  7. You must be a logged-in exclusive member to view this reply.

  8. Looking at doing something similar to the styling for categories, I'm asking the question on this post ...

    Currently, using the hybrid news theme as my base, I've done this in front-page.css and front-page.php (for the headlines area) which I now think may be long winded after reading this post.

    front-page.css:

    .category-title1 {
    	font: 1.5em Tahoma, Verdan, sans-serif;
    	color: #333;
    	font-weight: normal;
    	margin: 0 0 5px 15px;
    	padding: 0 0 5px 15px;
    	background: #fff url(images/sect1.jpg) repeat-x;
    	border-bottom: 8px solid #99CC33;
    	}
    
    .category-title1 a {
    	color: #333;
    	}
    
    .category-title2 {
    	font: 1.5em Tahoma, Verdan, sans-serif;
    	color: #333;
    	font-weight: normal;
    	margin: 0 0 5px 15px;
    	padding: 0 0 5px 15px;
    	background: #fff url(images/sect2.jpg) repeat-x;
    	border-bottom: 8px solid #CC3333;
    	}
    
    .category-title2 a {
    	color: #333;
    	}	
    
    .category-title3 {
    	font: 1.5em Tahoma, Verdan, sans-serif;
    	color: #333;
    	font-weight: normal;
    	margin: 0 0 5px 15px;
    	padding: 0 0 5px 12px;
    	background: #fff url(images/sect3.jpg) repeat-x;
    	border-bottom: 8px solid #FF99FF;
    	}
    ...

    Etc. for 6 categories ...

    front-page.php:

    <?php $cat = get_category( $category ); ?>
    
                            <?php
    						switch ($cat->name) {
       							case "Bollywood":
            					$colorclass = '<h3 class="category-title1">';
            					break;
        						case "Debate":
    							$colorclass = '<h3 class="category-title2">';
          				        break;
    							case "Fashion":
            					$colorclass = '<h3 class="category-title3">';
            					break;
    ...

    case statement for the 6 categories.

    url:
    http://204.13.53.139/~testing/

    Looking at the CSS styling option you mention I think it will be leaner and better. Could you please give me an example of how I can use that for this?

    I also want to use the same colours throughout the site for each of the categories e.g. put a colour bar at the top of the post for the category etc.

    Many thx

    Indi

  9. You must be a logged-in exclusive member to view this reply.

  10. Hi Justin,

    I'm asking about the body class styling for categories. How can I employ that into what I am doing as shown above? Or is there no point and stick with my approach? Where for the front page, categories appear with their colour via the case switch and not CSS.

    I want to assign colours to each category. So, the the title and coloured borders for the category always appear the same throughout the site.

  11. You want to have a colour scheme for each category styled with the use of body class rather than the solution you made ?

  12. You must be a logged-in exclusive member to view this reply.

  13. Hi Justin,

    Do I put the latter CSS statements in style.css for the child theme?

    Also, if i want to define them for the front-page, do i define them in front-page.css?

  14. You must be a logged-in exclusive member to view this reply.

  15. Hi Justin,

    I have applied this for my single posts which works well. But I have a problem. If a post is assigned to more than one category, the styling seems to choose the last category than the first.

    For Example,

    Post is assigned to categories : 'Arts & Culture', 'Dance'

    The style and colors for the 'Dance' category are appearing instead of 'Arts & Culture.'

    How do I get round this? Is it possible to prioritise categories for a post? e.g. prime, secondary etc. Or be selective about which category you want the styling to choose?

    Many thx

    Indi

  16. You must be a logged-in exclusive member to view this reply.

  17. I want to add an image in front of the category "headlines" on my front page. I understand the css code to customize the categories on the front page:

    .category-title1 {
    	font: 1.5em Tahoma, Verdan, sans-serif;
    	color: #333;
    	font-weight: normal;
    	margin: 0 0 5px 15px;
    	padding: 0 0 5px 15px;
    	background: #fff url(images/sect1.jpg) repeat-x;
    	border-bottom: 8px solid #99CC33;
    	}
    
    .category-title1 a {
    	color: #333;
    	}

    I don't, however, understand what alterations need to be made in the front-page.php file, if any, to make the css work.

    This is an older topic but can anyone offer a suggestion? My site is http://www.jenninejohnson.com

  18. You must be a logged-in exclusive member to view this reply.

  19. That's exactly what I was looking for. Thank you!

Reply

You must log in to post.

Limited Access

If you have an account, please take a moment to log in.

Non-exclusive members have limited access to the support forums.

To enjoy the full range of support, sign up for an exclusive membership in the theme club.

Support Forums

  • Bliss Theme (188 posts)
  • Hybrid Theme (16,976 posts)
  • Options Theme (10,322 posts)
  • Structure Theme (2,624 posts)
  • Visionary Theme (767 posts)
  • bbPress Themes (293 posts)
  • WordPress Plugins (1,614 posts)
  • General Discussion (3,955 posts)