You don’t need separate queries, you can run multiple loops on the same query-
// output first post
if( have_posts() ){
the_post();
the_title();
}
// output the rest of the posts...
if( have_posts() ){
while( have_posts() ){
the_post();
the_title();
}
}
You can also use rewind_posts() to reset the current post back to 0, as well as manually set $wp_query->current_post to whatever index you want and start the loop there (note: the post counter starts at 0, not 1).
If you only want to style the first post on the first page and not subsequent pages, you can check if it’s not paged with ! is_paged()
if( ! is_paged() ){
echo 'this will only output on the first page';
if( have_posts() ){
the_post();
the_title();
}
}
Related Posts:
- How to fix pagination for custom loops?
- Remove the Homepage Query
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Transient not working for custom loops
- post loop causes wp_users and wp_usermeta DB queries for each users
- get_the_foo() in the loop – does it perform another query?
- If No Search Results, Show Posts from Alternate Search Query
- How to Loop within a Loop (Display Children and then Grandchildren)
- Loop after page content
- A loop with all articles with certain text strings in tags
- Display most viewed post from last 30 days is not working correctly
- Query posts if meta key starts with
- 3 Posts in Loop, Show Stickies First
- How to go about combining dropdowns / filter queries?
- Query reset problem or flawed code to enable custom post type query
- Query last updated posts (posts updated in the last 24 hours)
- Conditional query that displays on Woo product attribute pages
- How do I use AJAX Query in my posts loop?
- woocommerce get_price_html not pulling in correct price
- How to fix pagination for custom loops?
- How can I paginate this?
- How to display posts by vote count and if no value continue with latest posts with no votes?
- How to fix pagination for custom loops?
- Split wordpress loop to multiple layouts
- Making a query to the DB using same parameters of loop
- Loop inside query
- get_delete_post_link() inside Loop stubbornly returns nothing
- loop inside the foreach
- Query posts only with actual text content (not including shortcode or images)
- Exclude posts based on an array
- Query post & loop problem.
- Loops for cat links not looping for wordpress site
- How do I set the Stewart Search Template to return only published posts in the result
- Trying to get all links in my posts
- Custom Query with Sticky Posts
- Build a Page which shows the Oldest Post with specific Custom Field Value
- Query posts and display all dates in repeater field in chronological order
- How to fix pagination for custom loops?
- Get featured image outside the loop using foreach
- Alternative layout the loop
- Show posts by tags excluding current post
- Strange problem with wp_get_attachment_image_src database (db) query count
- Next 10 posts data of currently viewing post in blog page
- How to fix pagination for custom loops?
- How to fix pagination for custom loops?
- How to fix pagination for custom loops?
- Get query result before posts are displayed?
- Combine Query and Select Database to create directory loop
- WordPress loop: Display if posts exist
- wordpress showing all posts instead of date range
- Multiple loop with pagination in same page
- Query Loop Block: possible to restrict just child pages?
- Use Base-URL with Query-Loop
- Using Query Loop Block to list all posts under each category
- Get date of last update outside of loop
- How do I get the attributes of a short code from a post?
- WordPress Number of Posts Not Changing With posts_per_page
- WordPress category & taxonomy loop with pagination
- Changing behavior of the loop twice in one page
- Show scheduled posts in archive page
- post__in – Placing content from a foreach loop inside of an array
- loop query exclude meta_key with meta_value
- “Blog pages show at most” in The Loop
- wp_insert_posts Fatal error: Maximum function nesting level of ‘100’ reached, aborting!
- Post Loop not Returning Permalink
- Displaying child page content of a certain parent
- Pagination adding extra posts only on page 2
- If Loop has odd number of posts on last page Custom style for last post in it
- add_filter() doesn’t work in loop
- The Loop in Static Page
- Content/Excerpt length control for a specific loop?
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Two loops by pre_get_post on same page
- How to check for specific content in comments in the loop
- Why we use if with while loop?
- Custom search form to display users only
- Loop to display random posts only if a custom field matches category
- Displaying the last page of posts
- How to get_posts where ‘menu_order’ is more than 0/zero?
- WordPress Redirects on Install
- How to load all pages into one page with their templates
- How to return only one instance of each, from the entire loop
- Combining action and filter?
- Shortcode with a foreach and arguments
- Create a new query in function.php to filter blog posts
- Calling & display certain product category loop and pagination on the homepage
- Order by empty custom field
- Detect if current page is front page within custom query
- Display Authors in a grid loop
- Blog’s post count cause irratic behavior
- Sanitize Custom Field Value in Meta Query
- Default ‘post’ post type archive slug?
- show random image in loop if image is not set
- Get Page content to displayin Bootstrap Modal
- Add static image block to lastest list item
- Place the Featured image on a post, before the first via code
- Alternatives to archive.php
- Advanced Custom Fields in WP_Query: Href Returning Empty
- Multiple queries and pagination