Prepare the query before you loop over it:
$first = array_shift( $the_query->posts );
$second = array_shift( $the_query->posts );
// now re-add in reverse order
array_unshift( $the_query->posts, $first );
array_unshift( $the_query->posts, $second ); // this is now the first item
while ($the_query -> have_posts()) : $the_query -> the_post(); // regular loop
Related Posts:
- How to show related posts by category
- How to display posts by current user/author in a custom page template?
- How to get previous 10 days post from a specific date – WP Query
- Query only Posts from Both of Two Category?
- Order post by year DESC and month ASC
- WordPress get posts by date without query_posts
- Can I set and show “important” post in my blog?
- Inserting custom data to the_post() during loop
- Why is querying posts messing up my pages?
- Any way for get_next_post() to use the actual post order instead of publish order?
- Order posts alphabetically: how to set order=asc in mysql query?
- How to get posts from a current post’s month?
- Display Posts with template on a Page
- Post Filtering by GET URL parameters
- How to give classname to post if post has no content?
- Get posts from current category?
- How to merge the content of posts that have the same title?
- get posts, run a custom query, and join the results
- WP_Query to get posts in a specific tag or has post_format
- How to get all post titles starting with numbers and symbols?
- Word count for all posts of all authors
- How to show related posts by detecting the current category?
- Get Posts Under Custom Taxonomy
- Keep featured content post in homepage with original order
- How to get posts published between a date and today?
- How to get post content by calling ajax?
- How to Change Order of Posts in Admin?
- Get the ID of the latest post
- Get current menu_order
- Different post sort order within different categories
- the_author() returns empty string
- get_children() Not Working with orderby Parameter
- How to get all posts related to particular category name?
- get all posts ID from a category
- what types of order can I pass to get_posts() via orderby?
- Display all posts from specific categories on a page
- Sort posts by popularity/page views
- get comments and get posts in loop
- How do I reorder (pop and push) items from WP_Query?
- How to exclude latest x posts from a paginated query?
- How to put last edited entry on top of the blog-post list?
- How to know if get_posts() failed?
- Sort post by attributes ‘order’
- How to sort posts by last name (2nd word) on ONE category only?
- Display content from a specific category
- post_name empty after wp_insert_post
- Query posts from current year
- Reverse chronology of post listing
- Query posts distinct authors
- Number of posts per page setting is not working?
- Show the title of the latest post by author
- WordPress Posts Out Of Order after 3.1 Update
- Setting pagination for images attached to a post
- Order Posts by Alphabetical for Each Letter
- Insert custom div between posts
- Set number of article per number of page
- Can’t show comments count per post outside loop
- is there a better way of combining this?
- Only display posts with comments
- Problem ordering posts with numbers for titles numerically E.g. 1, 10, 100
- ascending order custom post type
- How to choose a sort order (for posts) per category? (ideally when creating a new category)
- Display custom post types by date field
- How to Display Post View Count
- Different amount of posts on homepage than paged pages
- Featured Posts for Category Pages
- Quickest way to get last or oldest post date – WP Query
- Cannot Update A Post, 404 Error
- orderby=meta_value_num creates duplicate posts
- Function to show random posts from a category
- Hiding posts in a list from specified categories
- Posts are not showing up on particular category
- get selected post using $_GET
- Change Order of Admin Posts Depending on Meta
- How Can i Get 5 Recent Post Title With Corresponding Link?
- How would I get 1 latest post from a query for 5 posts?
- Display posts in alphabetical order for a particular category
- Filter Posts By Tag
- setup_postdata doesn`t seem ot be working
- post re-order on my site
- Display posts from #6 to #20 on archive page
- Exclude posts with empty post_content in wp_query
- Encrypt / Decrypt Post Title and Details
- Get Posts via Taxonomy Term Name with Space
- Get specific posts by ID in wordpress
- Improving WP_Query for performance when random posts are ordered
- Create dropdown list post
- I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
- Automatically republish old posts
- previewing my posts on static page?
- Exclude newest post from category X but show rest
- get_next_post() and get_previous_post() return wrong posts
- Reset Popular post query?
- Why orderby=”date” does not support manually changed posts?
- Get posts by name and taxonomy term
- How To Get Posts With A Specific Word
- How do I restart my loop with get_next_post()?
- Get mixed category random posts
- WordPress not opening posts with only numbers if permalink is post_name
- Limit popular posts by days