No. get_posts()
does not modify global $wp_query
variable and it doesn’t need to be cleaned up.
Note that if you further use setup_postdata()
you do need to wp_reset_postdata()
afterwards.
Related Posts:
- numberposts not responding to wp_reset_postdata()
- ACF Repeater loops and resets – where is the reset_rows() documentation? [closed]
- Post Loop not Returning Permalink
- Get posts that matches specific terms of multiple custom taxonomies
- Is get_posts() more efficient than The Loop?
- How to get_posts where ‘menu_order’ is more than 0/zero?
- Reset postdata to custom query in nested queries
- Display the_content on click jquery
- 3 Posts in Loop, Show Stickies First
- What is the maximum number of posts a WordPress loop can work with?
- Why only one post (and no pagination) on this variation of the loop?
- Sort posts by most recently modified
- A smarter way to display multiple loops inside a page template
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- Show all posts using the template page and the loop?
- Showing sticky posts with get_posts()
- query_posts() vs get_posts() multiple loops [duplicate]
- How do I paginate a get_posts() request inside another page loop (Paginating childpages)
- Both a page loop and posts loop on the same page
- How to get The Loop working with $wpdb->get_results()
- Multiple get_posts() queries on one page
- 404 Template customization | Want 10 recent Post on the 404.php error page apart from the error Notice
- Output meta into arrays
- Get post offset/posts page offset in single post page (outside the loop)
- get_posts() forcing ignore sticky posts on main loop
- loop inside a loop : search for posts in the same category
- php loop error for count posts in category
- get_posts and wp_autop (remove filter)
- Need some help with “the_widget()” function
- Is there a way to target only images within the loop?
- Show last post from multiple categories using wp_list_categories
- Question about custom plugin
- How can i display the content in plaintext
- Retrieve each widget separately from a sidebar
- Should I use loop in the single.php file?
- Where should I use post_class()?
- Loop through two different sets of custom fields
- get_the_foo() in the loop – does it perform another query?
- Exclude filter on front page
- Check if date of post is yesterday
- Exclude first 2 posts with meta_key from loop
- Fix inefficient loop breaks post.php on form submit
- Adding Pagination on a Custom Author Page
- Make a custom loop inside single.php with pagination
- Why do I get `Call to a member function have_posts() on a non-object `? [closed]
- Get Pagination (WP-PageNavi) not to work
- Filtering The Loop For Single Page and Blog Page
- the_content() seems to block my ACF-code
- Pulling current post/page data into header.php
- Loop and Page template : my WP_query don’t take args
- How to split a loop into two columns
- Transient loop issue
- Get single post from tags array
- Apply an Incremental Counter in an Array Function
- Latest Post Styled Different Than other Posts
- WordPress: Loop Help
- Woocommerce: How to display product price [closed]
- Loop counter style
- Can I add generic numbering HTML classes to items as a loop runs?
- Add “showing posts x to x of y” in custom post type paginated loop
- Custom Post Type on Homepage – Studiopress Genesis Framework
- New loop vs widget
- Display a single category in blog section
- Query Nopaging action not having effect
- Yoast taking over my WordPress title tag [closed]
- Pagination broken after using 2 loops to show content
- Getting page slug
- How to get pagination to work with 2 wordpress loops
- Exclude page from loop results
- How is WordPress changing the content markup?
- Inserting CPT and static content at every X post, is this possible?
- How to access $wp_query object from array of posts given by get_posts?
- loop through posts and display inserted media and post title as a link
- Custom Blog Loop on Home Page
- Exceprt not displaying
- Add File Attachment Name and URL into Javascript
- Open Graph in Index Loop
- How to add Default Level-0 parent and Level-1 class in WordPress Category in li element?
- Updating Post meta (ACF field) from Feed
- How to add pagination in Terms
- A code that I could not fully grasp related to foreach & count_user_posts()
- Related posts queries
- get_posts changes main query
- Trying to get property ‘post_content’ of non-object
- Include only one category but Exclude if is in a category from loop
- Homepage Loop Somehow Breaks Styling Of Post Grid
- Next 10 posts data of currently viewing post in blog page
- Get child taxonomies in loop
- WordPress Multiple Loop: Home/Archives Page, with pagination
- Placing the content of one post in two side by side columns, newspaper style
- trying to write a variable into a wp_query, need help!
- One loop for sticky, one for all the rest – how, without specifying category?
- Pass WP post content to a jQuery plugin (Fancybox)
- Showposts doesn’t show the number of posts indicated
- Using in_category for non standard loops
- How to do a loop inside a loop?
- How wp maps urls into files
- Custom Page Template and Category Exclusion
- Add static image block to lastest list item
- Place the Featured image on a post, before the first via code