WordPress.org

Ready to get started?Download WordPress

Forums

WP Tiles
[resolved] Color by post category (8 posts)

  1. josepmon
    Member
    Posted 9 months ago #

    Hi all,

    First I would like to thank you for such a useful plugin! It's just great!

    I only would like to know if there is anyway to use a determined background colour for each post category.

    Thanks!

    http://wordpress.org/plugins/wp-tiles/

  2. tylerjfrags
    Member
    Posted 9 months ago #

    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

  3. Mike
    Member
    Plugin Author

    Posted 9 months ago #

    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.

  4. josepmon
    Member
    Posted 9 months ago #

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

  5. iftomkins
    Member
    Posted 9 months ago #

    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

  6. aliceabc
    Member
    Posted 9 months ago #

    How I put the class on each post ? thanks

  7. Mike
    Member
    Plugin Author

    Posted 9 months ago #

    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;
    }
  8. iftomkins
    Member
    Posted 9 months ago #

    Works perfectly, thanks so much!

Reply

You must log in to post.

About this Plugin

About this Topic