Why wouldn’t you just pull them in the order you need instead of reversing the array?
$args = array(
'post_type' => 'attachment',
'posts_per_page' => -1, // correct key is posts_per_page, not numberposts
'orderby' => 'date'
'order' => 'ASC',
'post_parent' => $post->ID
);
$attachments = get_posts( $args );
Related Posts:
- Endless loop with wp_insert_post and wp_update_post
- Add Incrementing ID to each paragraph in the_content
- post__in – Placing content from a foreach loop inside of an array
- In a foreach loop, how do I target the last item in the loop?
- How to iterate through database until it find a match
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- How to print out menu names in the foreach loop?
- Add class to last 3 posts in loop
- Output meta into arrays
- Need to add class to first element in a foreach loop
- Simple foreach loop help needed in wordpress “the loop”
- How to print redux gallery feilds id? [closed]
- How to check all items in a loop have post thumbnail?
- Get featured image outside the loop using foreach
- Why loop renders only last metabox from array? [closed]
- Foundation modal in wordpress php loop
- ACF field not appearing correctly in loop
- Eliminate duplicates in a foreach loop [closed]
- Wrap every 2 divs in row – for each loop [closed]
- ACF loops false value with repeater and checkbox
- Get date of last update outside of loop
- WordPress category & taxonomy loop with pagination
- Changing behavior of the loop twice in one page
- How to add active class to custom menu using while loop and wp_list_pages
- 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
- How can I use get_permalink() outside the loop?
- Two loops by pre_get_post on same page
- How to check for specific content in comments in the loop
- How do I display the function the_content in this loop?
- Problem the_permalink
- How to get to a specific position in wp_query?
- Sort Posts By Category?
- Can’t access login screen, wp-login.php 404’s
- Facebook “like” open graph meta in header.php
- Create static front-page with 3-5 recent posts
- Custom Post Type Loop throws 500 error when used in widget
- How to use current_post to open a new unordered list every five posts
- How to sort posts based on the value (number) of a post’s metadata?
- How can I add extra word in permalink when someone click download button?
- Pagination for multiple loops
- How to target thumbnails of the first post in the loop
- Infinite Scroll on a loop?
- Can we count the WordPress Loop
- Include multiple page ids in loop
- “Call to a member function have_posts() on array” error on have_posts();
- Using wp_query to modify the loop in index.php for a CPT
- Assign custom parameter to each post in query
- How to exclude or filter password protected posts when using next_post_link() previous_post_link
- Is the 404 page automatically displayed if a loop returns nothing?
- Moving wordpress to different url/server creates redirect loop
- use loop to return blog details
- How to add post meta in while loop?
- Random post link generator messes up the loop
- How to Generate a list of Most Commented post?
- how can i order the category by date
- How to pick “full/thumbnail” images in the loop?
- excerpt not showing up
- Pagination for two loops
- Search.php gets metadata from first post
- Announces with different formatting dependently on a number
- Override orderby to create list of users by custom meta_value
- Thumbnail Image Rounded Corners w CSS (or any other good method)
- Several loops in sidebar issues
- Fetch data from two custom post types and create multidimensional array for output to html table
- List page is showing 404
- Adding $args to wp_schedule_event() causes hook to add infinitely to WP Cron
- $post is undefined in wordpress loop [ajax]
- Duplicated tag in loop
- Loop only shows first two posts
- Why is my archive page looping through all but one post?
- Loop two different category WP_Query
- Combine multiple separate lists into one
- Accordion headings cuts off to second line on collapsing a accordion heading (used acf repeater)
- WordPress Recent Posts – Loop
- ACF background-color per post in a WordPress loop
- My WordPress installation doesn’t load correct template
- Work arounds for conditional checks inside the loop in search.php?
- Transient not working for external data
- adding tax_query to $query_string
- Popular posts with Varnish ESI
- Querying posts from only one category and exluding the latest post
- WP_Post is not from correct array
- Post formating on Home page
- divide custom field values in div every two values
- Remove posts_orderby filter then add it back in
- the_title() Returns the page title instead of the post
- WP update_post_meta link loop
- Conditional Check in The Loop’s Parameters
- How does the JSON API work to parse incoming JSON and fetch a post based on an ID?
- How to add excerpt in loop in Twenty Eleven theme?
- Custom single.php files for different post formats
- Exclude Authors based off date of last post
- Troubleshooting “loopback requests that take too long”
- How to implement template file and the loop
- Show only posts from todays date [duplicate]
- Why did my most recent article fall behind an older one on my site?
- wp_mail function not working in user query loop
- How to set and retrieve cookies while in the loop