Yes, but not by calling the_post
twice in a loop.
Instead, use 2 loops and rewind_posts
. The first loop displays column1 and skips even posts. Then you call rewind_posts()
to go back to the beginning. The second loop displays column2 and skips odd posts.
After the first loop, call rewind_posts();
and it will rewind the main post loop back to the beginning again. If you’re using WP_Query
then the same function works for that if used on the query object e.g. $q->rewind_posts();
Related Posts:
- Should we trust the post globals?
- Get first post from wp_query
- WP_Query: Why is sticky post not first item in loop?
- Query *only* sticky posts
- How do I reorder (pop and push) items from WP_Query?
- How to exclude latest x posts from a paginated query?
- Reverse chronology of post listing
- WordPress Number of Posts Not Changing With posts_per_page
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Specific loop in Shortcode
- Search widget breaks when using multiple loops?
- Converting multiple loops into one single loop with pagination
- Display posts with comments closed, with pagination?
- Group posts by year in loop
- How would I get 1 latest post from a query for 5 posts?
- Loop through all product posts?
- WP Query – duplicated posts once including tags in search results
- Display post from current category and same tag?
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- WP Query – Posts Per Page not working in combination with category__in
- Pausing and Resuming WP_Query results
- How to : pagination in 3 different custom loops on the same page
- List authors with the last post title and order by last post date
- wp_query random post
- Possible to alternate between two loops
- How to get posts published on the latest date?
- Page and post loop same template
- Getting blog pagination to work on page set as front page
- Display current post position in Elementor Posts widget
- WP_Query: Show 10 posts in date order, first three random
- WordPress Loop: How to display recent posts in multiple divs
- How to display post list in a table layout (multiple queries in single loop)
- Not all posts showing in query
- how to handle the loop using filling bootstrap grid structure?
- Custom WP_Query not working correctly
- WP_Query of Category Not Showing First Post
- Display 3 posts with different HTML markup using a loop
- While loop in functions.php outputting the_title() of each post on frontpage
- Display specific posts based on an ID of another post
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- show loop id post , only first id can read
- Double loop output
- Loop through all posts showing duplicates
- Wp_query loop is not working as it should
- WordPress loop uses unmodified posts array, why?
- Advanced Post Display/Pagination/Ordering
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- How to show the posts list into a static page? Problems to use the loop into a static page
- Adding a category at even positions on main loop with modified pagination
- Make assigning post to a specific category equivalent to assigning it to all categories
- How do I show the post title if an advanced custom field hasn’t been used?
- First post in loop displays twice
- posts_per_page – Repeats only first posts ‘post__in’ array
- Accessing the post content with WP_Query
- Can’t show comments count per post outside loop
- How to output comments number of a post per day?
- Alternate custom content in the loop
- If specific user role then sticky post
- Auto Refresh Post List after X seconds
- Loop on front-page.php
- Custom WP_QUERY $args
- WordPress Loop – Next 3 Posts
- How to do set post permalinks using 6 digit random unique function?
- add to end of post in the loop with plugin
- Get posts with multiple categories
- Do not show children of a category
- WP_Query with custom post type ID
- How to give classname to post if post has no content?
- Custom wp-query in wordpress rest api
- posts_per_page returning only one post
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- How to retrieve certain number of images from a wordpress post?
- WordPress post filter menu
- Some doubts about how the loop work (trying debugging it)
- Current and next month posts
- Same post appears in related Posts?
- Get post category as a separate string and url
- How to show full post on home page
- ACF flexible content block not showing on live site (works locally)
- how to show comments only author which send own posts in wordpress
- How to sort WP_Post Object array by object field in php?
- How to create page with post content in it?
- How to remove a post from results by ID after query?
- Custom post Query and WordPress Post Query Clash
- Override wp_link_pages pagebreak with filter
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- Post being duplicated with foreach loop
- WP_Query extended with AJAX
- Custom post type – Loop out in random order but same 15 to appear first… still random
- WordPress infinite post cycle
- Blog only showing one post even though more published
- Post Format problem
- Sort / Filter Queries
- How do I control the fallback query after the original query returned cero posts?
- Order posts by separate menu order for different sub-categories
- What is wrong with this wp_query?
- The loop: more posts than I want to fit on one page
- date_query returning only the most recent post instead of the post published before today