Query for image attachments would be something like this (taken from Get The Image plugin/extension) with get_children()
:
$attachments = get_children( array(
'post_parent' => $args['post_id'],
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID'
) );
Then you can loop through array and retrieve URLs with wp_get_attachment_image_src()
which will get you URL and dimensions.
Related Posts:
- How do register_sidebar() and get_sidebar() work together?
- using upload image with media_handle_upload .. but !
- Show a WP 3.0 Custom Menu in an HTML Select with Auto-Navigation?
- Create a customizable child theme
- How to add “Read More…” link in twentytwenty
- How to add custom page attributes in WordPress?
- Where are Additional CSS files stored
- How to Link External jQuery/Javascript files with WordPress
- Prevent WordPress from automatically installing a new theme each year
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Using classes instead of global functions in functions.php
- Display random categories on the front page (Finding and Editing Theme Functions)
- how to override woocommerce specific loop or archive-product.php [closed]
- Looking for a lightweight theme using WP3 new tags and features (not 2010) [closed]
- Any official way to create an admin theme?
- Template for individual post designs
- switch theme on fly
- Why isn’t is_home() working correctly?
- wp_nav_menu() custom container and container_id
- 2 seperate installation 1 theme same server
- Can You Export Theme Settings From WordPress Multisite?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Automatic image renaming based on title
- FireFox Inspector :: find CSS file related to
- Widgets vs. Theme Mods
- Automatically wrap post image in div
- get_theme_mod(); returns nothing
- Front End Post Submit Form
- Get the post attached to a image attachment
- Are there any ‘Coming Soon’ themes for WordPress 3.0?
- Make page template that is just an “include” of another?
- Show attribute description when filtering by that attribute
- Is it ok to not a have child theme and just create a theme from scratch?
- Upgrading a custom theme through the Dashboard
- sanitize attachment filename
- Importing media medium setting image gallery / image attachments
- Theme Customizer not loading
- Widgets not showing in my custom theme
- How can I & how do I change text displayed in comment via child theme
- Version control for both Vagrant config and themes being developed [closed]
- How do I copy all “extra” data (menus, widgets, etc) from one theme to another?
- How to correctly add JQuery in a WP theme?
- woocommerce Add custom field set like billing fields
- $wp_customize->remove_section for customizer setting?
- Modify a theme to insert custom widgets?
- Cannot figure out how to center div in WordPress theme [closed]
- How to add a second stylesheet to the editor
- how can I change the background color of all posts on my server?
- WP 3.1 upgrade breaks AutoFocus+ theme
- WP Northwind for Theme Development?
- Add more then one site logo – custom-logo theme support
- Updating Existed RocketTheme Theme on WordPress
- Setting custom search engine indexing for a “dynamic WordPress page” with htaccess
- How can I defer these JS files?
- Customizer: Output default value in Customizer CSS
- title, content, feature images
- Get page ID outside the loop, matching menu ID
- Putting tag outside tag on generated Menu
- How to customize core admin pages within a theme?
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- Warning: Creating default object… when altering Customize panels
- How to make theme elements customizable in wordpress?
- Theme licensing and permission on changing content [closed]
- @font-face is not working in WordPress
- Custom attachments styling in post view
- Limitations when modifying wp_title with a filter
- What changes we need to make to a theme so it can be installed as a MU Theme?
- How to edit theme functions file to modify pagination?
- Updates for a private theme
- How to create left and right menu with logo center in a custom theme?
- How do I change the markup only of a built-in widget?
- custom theme ,add media not showing images in media library
- Customizer: active_callback and sanitize_callback incompatibility?
- Theme Customization through admin panel. (Appearance-Customize)
- Customizer: save setting/control content to post/page
- For a specific theme, how do I build a list of all the possible theme modification names?
- Navigation label for page in custom theme
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- REQUIRED: Could not find wp_link_pages. See: wp_link_pages by Theme Checker
- problem in uploading attachment to custom directory
- Customize how a WordPress theme looks like in the Theme Selector
- Blog page problems
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Integrate WooCommerce theme with a WordPress theme [closed]
- Widget Option is Missing
- How do you use WordPress for a website that’s not in a blog format?
- How do I get the trackback count of a post in wordpress without writing an SQL query?
- Extend WordPress Core Classes in OOP Theme?
- Installing new theme on running site
- User bar above logotipo?
- Is there a way to override require_once of the main theme on the child theme?
- Moving wp-content folder
- WordPress broken after domain name change
- Edit value=”” of a button in child theme
- How to customize the WordPress 2014 theme, to have page using less horizontal margin?
- How to edit alternate inactive themes in “Appearance -> Customise” screen?
- searchform.php doesn’t work properly
- Customizer: get_preview_url() inside customize_save_after hook
- How to create custom layouts and static pages in themes for clients
- How to have multiple WordPress Menus