Linked Questions

0 votes
1 answer
2k views

Apply class to every third list item? [duplicate]

Possible Duplicate: How to mark every 3rd post I'm trying to give a class to every third list item on my page. I know how to give a class to every item, but not to specific items in a row, or in ...
Phill's user avatar
  • 197
0 votes
1 answer
2k views

Style first 3 posts differently with WP_Query [duplicate]

I've got the following code, which gets the first 3 posts. However, I am hoping to style each differently with if statements. But when I add if statements (to determine whether it is the first or ...
tmyie's user avatar
  • 863
-1 votes
1 answer
2k views

Wordpress custom post type odd and even styling [duplicate]

I've got a custom post type that I would like to be able to show in the following: is this possible using the following code: <?php query_posts(array('post_type' => 'story', 'orderby' => '...
user1888564's user avatar
0 votes
1 answer
1k views

How to repeat a loop after 4 posts [duplicate]

Possible Duplicate: How to mark every 3rd post Style every four posts differently Is it possible to repeat this loop after four posts? (post 5 = post 1 css, post 6 = post 2 css, etc..) <?...
Phife Dawz's user avatar
0 votes
1 answer
408 views

Style every four posts differently [duplicate]

Possible Duplicate: How to mark every 3rd post Is it possible to style every four posts differently? I mean something like this: <div class="row"> <div>1st post</div> <div&...
Phife Dawz's user avatar
0 votes
0 answers
90 views

Styling every second Post differently? [duplicate]

I wanted to style every second post inside of a query post and I found a solution which nearly works. the thing is: it outputs just two posts (older ones will be igrnored) but i want to output ALL ...
Jochen Schmidt's user avatar
15 votes
3 answers
3k views

the_content and is_main_query

I am filtering the content with the the_content filter. Everything works perfect, excerpt that my changes are applied to custom queries as well. My changes appear in the sidebar as well if the widget ...
Pieter Goosen's user avatar
2 votes
2 answers
2k views

Notice: Undefined property: wpdb::$current_post What can be wrong?

I'm working on a WordPress site and I use the following code to show posts in two columns on archive and category pages: <div id="post-<?php the_ID(); ?>" <?php post_class( 0 === ++$...
Knott's user avatar
  • 454
1 vote
2 answers
4k views

Alternating post layout

I am trying to create a layout with two different divs alternating vertically. For example the even has to be: picture + content; and the odd has to be: content + picture. Here is my code, at the ...
Mark's user avatar
  • 341
0 votes
1 answer
4k views

How to create bootstrap grid loop?

May I know how to create multiple loop for this HTML code in Wordpress? <div class="row"> <div class="col-md-3 col-sm-6"> <div class="normal-video"> ...
The Lee's user avatar
  • 21
0 votes
3 answers
2k views

Add class to every other posts using get_posts

I am currently using this little loop to display a list of posts using the "events" custom post type <?php global $post; // required $args = array('post_type' => 'events'); $...
Dean Elliott's user avatar
1 vote
1 answer
2k views

Add class to first post in custom loop using post_class filter

I am trying to add a class to the first post in a custom WP_Query. I can add a class to the first post of the standard WordPress loop using; add_filter( 'post_class', 'featured_classes' ); function ...
tmgale12's user avatar
0 votes
2 answers
357 views

Customise the appearance of 4 specific post ID's within the loop?

I am using Isotope and I currently have each post rendering as a box on my homepage. I am currently trying to edit my (working) query that currently displays all posts with the category slug of '...
egr103's user avatar
  • 305
1 vote
1 answer
169 views

Multi row post list

I'm trying to create a 'two posts per row grid'. Here is the template i made: <div class="row"> <div class="span2"> <?php get_sidebar(); ?> </div> <div class="...
OKdk's user avatar
  • 11