WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I change roll over color depending on category, Imbalance Theme (4 posts)

  1. jmsole
    Member
    Posted 3 years ago #

    Hi. I'm new at wordpress and I have a problem I can't solve. I'm using the Imbalance Theme by WPSHOWER to make my portfolio (jmsole.cl) and I have modified it a bit. The problem I'm having is that I want the roll over color of the grid elements in the startpage to change color automaticaly depending on the category it belongs to.
    I been trying for a while and I can change them manually in the .css, but doing it that way I have to specify the column and the post-id, so if I add a new post I have to change everything again.
    Hope there's someone who can help me.
    Thanks in advance

    JM Solé

    PS: I hope you understand that english is noy my native language, please forgive me for any error.

  2. alchymyth
    Forum Moderator
    Posted 3 years ago #

    check if you could use post_class() in the post's div, which will give category-dependant css classes to the post div (apart from many other css classes as well)

    http://codex.wordpress.org/Template_Tags/post_class

  3. jmsole
    Member
    Posted 3 years ago #

    Thank you alchymyth, I tried to use post_class() in the blog.php of the theme, in the area that defines the post thumbnail. I think that what I need to do is to assign post_class() to class="preview", because when I modify .preview in the .css the backgorund of the roll over changes. But I really am a newbie when it come to WordPress.
    I think I have to get to a point where I can put .preview.category-5 in the .css and assign to that the background color. I think that's the easiest way to do it, but I don't know how to modify blog.php for that CSS code to work.

    Thank you again. I hope someone can tell me what to write in the .php, because I think I don't have the ability to decifer this.

    JM Solé

  4. jmsole
    Member
    Posted 3 years ago #

    Yeasterday I found this post and now it works like I wanted it to work. And of course, I was trying to put the code in the wrong .php. Thank you alchymyth for your help.

    JM Solé

Topic Closed

This topic has been closed to new replies.

About this Topic