WP Query for 1 post at a time
-
How can I use WP Query to display one post at a time. So for example:
<div class="first"> POST 1 content </div> <div class"second half-width"> POST 2 content </div> <div class-third half-width"> POST 3 content </div>
(notice the different classes for each div)
I’m trying to achieve a masonry-ish format for custom post types. From what I understand the
WP_Query()
function will take a posts-per-page argument, but anything greater than 1 will cause it to loop.What I want to do is create my query, use
the_content()
for the first post, then later on down my HTML code usethe_content()
for the second and third post etc. Is there any way to dothe_content()
for the first post and then make the query move to the second post without looping?
- The topic ‘WP Query for 1 post at a time’ is closed to new replies.