Jump to content


Photo

Highlight every second post with background color


  • Please log in to reply
3 replies to this topic

#1 kkjaerbye

kkjaerbye

    Member

  • Members
  • PipPip
  • 12 posts

Posted 23 August 2012 - 01:48 PM

Hi experts,

I'm looking for at way to make my post's page look more readable. I'd like every second post (odd/even) to have a little darker background color than the posts around it. That way it's easyer to distinguish between the posts. I'm using the "magazine layout mode".

To be clear
Post 1: regular background color
Post 2: light green/cream background color
Post 3: regular background color
Post 4: light green/cream background color
... and so on ...

Actually I'm looking for something looking like this.

Is anybody expert enough to help me with this? I'm running my site an a local server for intranet use why I can't show you my site URL.

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 23 August 2012 - 03:08 PM

There is a PHP way, but as I was searching, I found solutions that may need adjustment (for example: http://wphacks.com/h...kground-colors/). For this, you may want to hire a Pro to help you out: http://www.pagelines.com/pros/

#3 kkjaerbye

kkjaerbye

    Member

  • Members
  • PipPip
  • 12 posts

Posted 24 August 2012 - 06:48 AM

Thank you, Catrina. I'll look into it but don't even now in which file I need to start creating "a loop counter" before the loop. No one else with some kind of tutorial or idea? I'm convinced that this can't be too hard to solve.

#4 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 24 August 2012 - 03:01 PM

The PageLines structure is a bit different from the standard WordPress theme structure, but the file you need to look into is the postloop file. (You will need the base theme installed first, though: http://www.pagelines..._the_Base_Theme)