| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Crankshaft
Join Date: Apr 2003
Posts: 2,107
|
php help
I'm building a site running on wordpress. I'm pulling all posts out of a category into a grid of 6 per page (2 lines of 3). What I want to do is echo out a div breaker after each line of 3 posts. I've got it working if there is a total of 3 posts per line but I need to echo it if a new line in the grid has been created: ![]() hit me up. |
|
|
|
|
|
#2 (permalink) |
|
Pixelpoodle.com
Join Date: Sep 2007
Location: Leuven, Belgium
Posts: 655
|
not quite sure i understand but can't you just echo the div before post number 4 ( so in the 4th loop before you echo the post ), and have the bottom div fixed in the layout ? |
|
|
|
#4 (permalink) | |
|
Crankshaft
Join Date: Apr 2003
Posts: 2,107
|
Quote:
can't use that method as it doubles up the breaker. |
|
|
|
|
#5 (permalink) | |
|
Crankshaft
Join Date: Apr 2003
Posts: 2,107
|
Quote:
just a simple count inside the wp query: PHP Code:
|
|
|
|
|
#6 (permalink) |
|
Ruler of Planet Houston
Join Date: Feb 2010
Posts: 131
|
Would this not work? PHP Code:
I ain't got time to bleed!
|
|
|
|
#7 (permalink) | |
|
Pixelpoodle.com
Join Date: Sep 2007
Location: Leuven, Belgium
Posts: 655
|
Quote:
I don't see how that would double the breaker ? If you do it in the 4th loop before you echo your post, then it will only echo in case there is a 4th item, when there are only 3 it will just show the static one. |
|
|
![]() |
|