You can do this using general programming/common sense with a variable and an if
statement, no WordPress knowledge is required.
If we create a variable named $skip_next
and set it to true
, then perform a check in the loop, we can set it to false and continue
to skip the first.
$skip_next = true;
while ( $blog_posts->have_posts() ) {
if ( $skip_next ) {
$skip_next = false;
continuel
}
$blog_posts->the_post();
Now because $skip_next
is false on the second post it will not be skipped
Related Posts:
- Build a content and excerpt grid loop with paging and options for # of posts
- how to display active, upcoming and past event with featured listing with pagination
- Exclude posts from homepage having a specified tag
- Can’t search posts using WP_QUERY inside AJAX Function
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- How to get post ID in a Page?
- change the default order of posts only for specific categories
- Getting posts to exclude from array
- Get all posts as an array ID => Name
- Custom post type permalinks do not appear using the link functions
- posts_nav_link pulling in multiple post types
- Remove Post if Advanced Custom Field is checked to fix paging
- Toolbar Hidden in a Virtual Page
- Search.php gets metadata from first post
- search.php to search only the post title
- WordPress sorting posts by date and title using a dropdown
- Trying to get pagination working on WP_Query() post grid
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Create a hierarchical loop at predefined markup requirements
- Custom query_posts() parameter
- Does wp_query and query_posts affect website performance? [duplicate]
- Pagination in category.php not functioning
- How to modify this function to exclude also the post belonging to a specific category?
- Variable ++ in query loop
- /page/2/ redirect to 404
- How do I exclude the current post from the upcoming post query
- How could I prevent using the same custom loop in a template file when I only need to change one meta_query parameter?
- Can’t load WP function into external function
- Hide post if matches current month and year
- Custom category code not showing all posts
- Displaying theme options in css
- Get the last month with posts using a recursive function…
- max_input_vars: how many am I using?
- Use WP_Query in shortcode
- have_posts() execution failure
- How to show a dynamic_sidebar if main content content’s height is > a set amount?
- Set WordPress Default Template
- Working with query_posts ( arrays and query strings)
- Custom URL parameters in template files
- How to filter posts by post format “standard” from wp-json api?
- Why is variable not working on custom sql query using wpdb?
- How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?
- How to query for pages/post depending on slug?
- How can I use wp_query to show all product data using just the products ID?
- Adding country tags automatically
- write custom woocommerce templates and forms
- Implement toggle switch for theme options in settings API
- Using a `Template Parts` folder instead of an `Includes` folder in a Custom WordPress Theme
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Using a variable in is_page(array())
- Random order of WP_Query results with highest meta value
- Trigger popup in a php if/else statement
- Anyway to output the registration form like the login form with wp_login_form()?
- Custom page archive query by url var calling page twice on one of my custom queries?
- How do I get current page ID in WordPress customizer file?
- WordPress custom slug (endpoint) and compare all links
- Customizer: Output default value in Customizer CSS
- How to load a template-part based on a url wildcard?
- WordPress does not load page.php, return 404.php
- How can i upload images in an admin page?
- Where to edit the template that is generating the code for dynamic_sidebar left-sidebar in the Understrap theme? [closed]
- How to query for posts with a null or blank post_name?
- WordPress pagination not working with search page
- get current custom post ID by WP_Query method
- Multiple WordPress Menus that will only display all pages
- Set the checkbox as checked by default at options page
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Displaying the last post on static homepage
- Using foreach loop breaks
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Add child pages of parent to navbar PHP
- How can I create a list of page titles from custom meta values?
- Load a page into a div with Ajax
- Create WP_Query to search for posts by their categories or their parent/child categories
- WP Query with custom Shortcode
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- wp_query with cat not working
- Theme Options Page – User Updates Logo
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- Converting HTML Template to WordPress Theme
- How to use an associative array in post__in with WP_Query?
- How to use my style.css file outside of wordpress subdomain?
- How to show part of the_content?
- Wp-login appears White Screen, Error: Cannot modify header information
- How to remove the cufon script from Dzonia Lite theme [closed]
- get_the_tags() not iterating through for/while loop, but will with foreach
- If Query In Sidebar
- Using loop pagination on single.php
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Logged in user ID as post ID
- Compare post-IDs within WP_Query? (Less than / Greater than)
- Sort query_posts for Parent Pages to menue order or the count?
- Hide categories that are not used in the post type
- How do I add custom bulk actions to multiple custom post types?
- Add_action not working in required file of functions.php
- How to use $query->set with post__in?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?