Neither of those are complete loops. That is, in both you have the start of an if
but not the end of it, and the start of a while
loop, but no the end of it. Also, you shouldn’t be using query_posts
either, as it over writes the main query and is rarely the right function for pulling posts. get_posts
would be better.
I would do this, using one as an example:
<?php $r = get_posts('offset=1');
if ( !empty($r) ) :
foreach ( $r as $post ) :
setup_postdata($post);
// stuff
endforeach;
endif; ?>
That should solve your problem with the page not loading.
What you are doing can be done with a single loop though, since get_posts without the offset will pull everything. You just need to take the first element as the recent post and loop through the rest.
Related Posts:
- Related Posts loop – offset
- Two custom loops, pagination, offset
- Create static front-page with 3-5 recent posts
- the_excerpt not showing posts
- Missing image in gallery shortcode in custom feed
- Get post offset/posts page offset in single post page (outside the loop)
- Loop Offset for tag based “Related Posts”
- Problem with Front-Page.php loading recent posts
- Where to add offset?
- Offset for Loop
- Style first 3 posts differently and use a 2nd loop to get rest of posts / offset and pagination broken
- How to fix pagination for custom loops?
- Jquery Slider for profile template
- Counting the posts of a custom WordPress loop (WP_Query)?
- if ( is_home() && ! is_front_page() )
- Get excerpt using get_the_excerpt outside a loop
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- Get post content from outside the loop
- Why should I put if(have_posts()), is while(have_posts()) not enough?
- Display featured products through custom loop in woocommerce on template page
- Split Content and Gallery
- How to get Author ID outside the loop
- How can i display the content in plaintext
- Redirect loop when trying to login to /wp-admin/ [duplicate]
- How to split a loop into multiple columns
- Is it necessary to reset the query after using get_posts()?
- Is there any difference between the_title() and echo get_the_title()?
- AJAX with loop filtering categories
- Do I need to use The Loop on pages?
- Remove the Homepage Query
- remove tags from the_content
- the_title() shows title of the first post instead of the page title?
- How to force excerpts / teasers in the loop
- Retrieve each widget separately from a sidebar
- Why am I being limited to ten posts on a custom loop?
- Should I use loop in the single.php file?
- A search for ‘0’ returns results
- Why do themes rely on “The Loop”?
- How to return loop contents
- Using the Loop to show all levels of subpages under a parent page? Halfway there
- Cleanest Way to Select Every Second Element in a Loop?
- Insert image or ad script after 3 posts using the loop
- Get date of last update outside of loop
- Pagination not working on home page
- Child Pages Loop
- How to place comments_template(); outside the loop?
- Multiple Loops Homepage?
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)
- how to upload image using wp_handle_upload
- Avoiding using a loop to access a single post
- How to get the first image gallery of a product in woocommerce in a loop
- Get post by page name or slug
- save_post + insert_post = infinite loop
- Loop.php vs looping inside template file
- Get ID of a page containing secondary loop in content
- Custom Loop and Infinite Scroll
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- the_content and wp_link_pages
- Adding ‘current_post_item’ class to current post in the loop
- How do I get the attributes of a short code from a post?
- How can I custom order the results from wp_list_categories?
- ACF Repeater loops and resets – where is the reset_rows() documentation? [closed]
- WooCommerce Product Page Loop – Output All Product Thumbnails
- wp-admin redirecting to https, denying login
- Endless loop with wp_insert_post and wp_update_post
- Display subpages under parent page as a list within a loop
- Why is it necessary to call rewind_posts() when using the loop more than once? [duplicate]
- When to use wp_reset_postdata();
- Is including the loop necessary for page.php? [duplicate]
- the_title(); works in a page template, outside the loop. Why?
- wordpress loop for specific category
- Add 20yrs to post date, and then query
- Why do themes have `while( have_posts() )` in templates like single.php?
- When and Why is is_singular(‘my_cpt’) true while in_the_loop() is false?
- Three different post types on homepage
- What is best way passing variables to theme templates and using them different places like widgets?
- Apply styling only to first page sticky posts
- WordPress category & taxonomy loop with pagination
- Add Incrementing ID to each paragraph in the_content
- Changing behavior of the loop twice in one page
- How do I prevent one of two multiple loops from repeating on a second page?
- Insert/sticky specific post into Loop at specific location
- Style every four posts differently [duplicate]
- Return vs Echo Shortcode
- wp_list_categories: get latest featured_image of category
- Add inline HTML to posts published within last 24hrs
- Hook into the loop via a plugin, and output something after every X post?
- Multiple posts with one loop iteration
- Identify the page being shown while in The Loop
- WordPress Alphabetical Glossary close div in loop
- Query date in wordpress loop
- How to find meta_values to call
- Alternate loop output every three posts (within the same original loop)
- Show newly added posts since last user login time /date
- Show scheduled posts in archive page
- Use the_content outside the loop
- What exactly defines a Main Loop and a Secondary Loop?