Skip to:
Content
Pages
Categories
Search
Top
Bottom

Alternating comment colours in the activity stream on default theme


  • hal9000
    Member

    @hal9000

    Hi there, I am using the default theme which is slightly modified (nothing major) and would love to have alternating comment backgrounds in this theme. I have found lots of methods for wordpress and older versions of wp but none work. Does anyone have a sure fire way of adding odd and even to the comments.php loop so i can css it up?
    Thanks in advance
    hal9000

Viewing 2 replies - 1 through 2 (of 2 total)

  • Virtuali
    Participant

    @gunju2221

    You can have an alternate color of whatever you want in your theme via css, with this simple css rule:

    ` tr.alt { background-color: #f4f4f4; } `

    Since your using the buddypress default theme, you will add this rule under the:

    `/* > WordPress Blog Comment Styles


    */` to something like:

    `#comments ol.commentlist tr.alt {
    background-color: #f4f4f4;
    }`

    @hal9000 to get alternating colors on any of your loops (activity, members, groups, blog listings, forums, whatever)… using this code (uses CSS3)

    li { background: green; }
    li:nth-child(odd) { background: red; }

    more specifically:
    in the default.css stylesheet of the buddypress default theme… you should find on line 396:
    ul.item-list li {
    position: relative;
    padding: 15px 0;
    border-bottom: 1px solid #eaeaea;
    }

    replace that with this:
    ul.item-list li {
    position: relative;
    padding: 15px 0;
    border-bottom: none;
    background: green;
    }

    ul.item-list li:nth-child(odd) {
    background: red;
    }

    and wolla!! ofcourse… please change the red and green to the colors of your theme… also, if you need it specifically for members, or groups, etc… then in the source code of each page , for eg, in groups, it is under a particular id: groups-list… put the styles under that id and so on.. hope that makes sense to you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Alternating comment colours in the activity stream on default theme’ is closed to new replies.
Skip to toolbar