WordPress.org

Support

Support » Plugins and Hacks » WP Tiles » [Resolved] Color by post category

[Resolved] Color by post category

Viewing 7 replies - 1 through 7 (of 7 total)
  • This is possible..

    Have a look at my site: http://www.thenoisegate.com

    WP-Tiles will include your category as a class in the div.

    Here’s my code for the border. I had to use !important in the css to get it to work properly.

    .wp-tile-container .grid .News { border-bottom: 7px solid #eea95c !important; }

    Be careful if your category name is made up of two words. You will only have to use one word as the class to activate the color change

    Plugin Author Mike Martel

    @mike_cowobo

    Thanks for replying @tylerjfrags.

    That would be the best way to go about this. To avoid using !important styles, you just have to make the css rule more specific than the ones from the plugin (more specific rules have precedence). The easiest way to achieve this is to add ‘div’ before .wp-tile-container. Keeps the code more manageable 🙂

    div.wp-tile-container .grid .News {
        border-bottom: 7px solid #eea95c;
    }

    Btw. nice work integrating the plugin into your website!

    @josepmon: Feel free to post again if you have problems with this solution.

    Thanks for the replies guys! I will try it as soon as posible!

    Hi Mike — Again, as has been said, thanks for the awesome plugin!

    I’m trying to style the posts differently by category, but I don’t see the post categories being appended as a class anywhere in the tile divs. Is this a customization I must make? If so, any tips on the best way to hook in or modify the plugin files would be much appreciated.

    Cheers!
    Alan

    How I put the class on each post ? thanks

    Plugin Author Mike Martel

    @mike_cowobo

    Hi everyone.. better late than never: my earlier answer was wrong! WP Tiles did not add categories to the tile classes. I updated WP Tiles just now to version 0.5.7, which does include category classes!

    Nb. I used slugs instead of category names. So the category “My Category” will most likely by “my-category”. So in the earlier example:

    div.wp-tile-container .grid .my-category {
        border-bottom: 7px solid #eea95c;
    }

    Works perfectly, thanks so much!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Color by post category’ is closed to new replies.
Skip to toolbar