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
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Display random categories on the front page (Finding and Editing Theme Functions)
- 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
- Automatic image renaming based on title
- FireFox Inspector :: find CSS file related to
- Widgets vs. Theme Mods
- Front End Post Submit Form
- Show attribute description when filtering by that attribute
- Is it ok to not a have child theme and just create a theme from scratch?
- 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
- 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?
- 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
- Add more then one site logo – custom-logo theme support
- How can I defer these JS files?
- Get page ID outside the loop, matching menu ID
- Putting tag outside tag on generated Menu
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- How to make theme elements customizable in wordpress?
- Theme licensing and permission on changing content [closed]
- Limitations when modifying wp_title with a filter
- 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?
- Customizer: active_callback and sanitize_callback incompatibility?
- 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
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Integrate WooCommerce theme with a WordPress theme [closed]
- 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?
- User bar above logotipo?
- Moving wp-content folder
- Edit value=”” of a button in child theme
- How to customize the WordPress 2014 theme, to have page using less horizontal margin?
- 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
- New to WordPress – Read the Codex, Other Docs; Still Confused
- How to add custom page elements to the WYSIWYG editor?
- Create a Page template selector page
- Can’t change theme name
- How to add WordPress JS Script Links
- Attach File Funcion for Common people
- how or where wordress collect unlogged user session
- Change default Video Player without Plugin
- Trying to customise 2011 Child Theme Background Colour
- Lost customization after switching the WordPress theme
- Lightbox not showing image caption
- WordPress core jquery version file not loaded?
- Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
- How replace theme styles?
- Delete page titles
- Issue with navigation bar in child theme
- using themename_the_custom_logo() in template-tags?
- How do I target this page specifically?
- How do I change the content of an element for a theme without losing the styling?
- How to Password Protect whole site except for some subdirectories
- How do I move my sites to a child theme without loosing customisation?
- Any way to permanently translate themes?
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- Use another theme template in my theme
- Managing Custom Designed Content
- How do I change text of a product template in a WooCommerce theme? [closed]
- How to prevent XSS attack in wordpress theme?
- Show posts from all categories
- Post thats in Two Categories, only want to display name for one
- Custom CSS File wont work on second Page
- Consolidate ‘add-to-cart’ buttons into one ‘add-all-to-cart’ button
- customizing a theme [closed]
- I have one page in my WordPress site with a table that needs to be super compact and simple
- Changes to code not displaying