First you will need to get a list of all available sizes on your site. This function get_intermediate_image_sizes()
will do that. You can then pass the results of that to image_get_intermediate_size()
along with the post id and
<?php $sizes = get_intermediate_image_sizes(); ?>
<?php foreach($major_data as $postID) { ;?>
<?php $postData = get_post( $postID );?>
<?php print $postData->post_title;?><br>
<?php var_dump(image_get_intermediate_size( $postID, $sizes )); ?>
<?php } ?>
more info on this function get_intermediate_image_sizes()
lot of good functions for dealing with images in the media.php wordpress core file
Related Posts:
- How to fix pagination for custom loops?
- Query multiple custom post types in single loop
- Remove the Homepage Query
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Endless loop with wp_insert_post and wp_update_post
- Add Incrementing ID to each paragraph in the_content
- Transient not working for custom loops
- post__in – Placing content from a foreach loop inside of an array
- Specific Loop For 2 Within Each
- 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
- In a foreach loop, how do I target the last item in the loop?
- How to Loop within a Loop (Display Children and then Grandchildren)
- How to iterate through database until it find a match
- Loop posts only excluding first post
- spliting posts into two columns
- How to get to a specific position in wp_query?
- 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?
- Increase offset while looping
- woocommerce get_price_html not pulling in correct price
- Get all posts including sticky ones with get_posts(),setup_postdata(), and foreach loop?
- How to print out menu names in the foreach loop?
- 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
- Add class to last 3 posts in loop
- Loop inside query
- Output meta into arrays
- How to add div blocks after certain set of post
- Need to add class to first element in a foreach loop
- How to overwrite orderby with add_query_var
- Foreach displays from last to first
- Simple foreach loop help needed in wordpress “the loop”
- WordPress query undefined offset in loop
- Issue with custom loop in Archive page
- How to print redux gallery feilds id? [closed]
- 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)
- Limit tags shown in post
- Echo array value
- Exclude posts based on an array
- Query post & loop problem.
- How to check all items in a loop have post thumbnail?
- 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
- Display articles with a different template in the home page | Solved |
- 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?
- Alternative layout the loop
- Why loop renders only last metabox from array? [closed]
- Show posts by tags excluding current post
- Strange problem with wp_get_attachment_image_src database (db) query count
- Foundation modal in wordpress php loop
- ACF field not appearing correctly in loop
- Next 10 posts data of currently viewing post in blog page
- How to fix pagination for custom loops?
- Problems With Query and/or Template Part and/or PHP
- 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
- 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
- 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
- Getting the correct post ID in WordPress query loop
- Dinamis Query Loop template Custom Post Type dan Taxonomy di WordPress Blocks dengan PHP
- Using an ACF field from a page within a post loop?
- Duplicate posts in paginated results
- Publish Categories for a particular Author on a given Post
- How to set variable, pass it to a partial file and remove it after?
- how to refresh div on template part?
- Detect if current page is front page within custom query
- Function to delete a post, it’s children and it’s grand children (half way there already)
- Output loop leveraged shortcode twice on one page
- How to pre populate a form field with a link of a current user’s author profile?
- The Loop – mixed ASC and DESC order