0
votes
3answers
240 views

Get wp_get_attachment_url outside of loop

I need to get the featured image outside the loop. This is so that I can have a different full-screen background image for each page, set by the featured image. After doing some research I was able ...
0
votes
3answers
120 views

search through post-type attachments titles

I have a page where I show all the attachments of a page in a table which has id=10. I have hundreds of attachments and I would like to implement an AJAX search form that uses the title of attachment ...
1
vote
1answer
238 views

Show how many images are attached to a post/page on compose page

On the front-end, I'm using a query to show all attachments attached to the current post. However, on the compose page, there's no way for a user to see how many images are attached without opening up ...
1
vote
1answer
332 views

How to retrieve attachments from child pages of a specific Page?

How would I retrieve attachments from all subpages of a specific Page ID? Example: SPECIFIC PAGE Child (with attachments) Child (with attachments) Child (with attachments) I'm currently ...
0
votes
2answers
240 views

List Wordpress Post and Related Attachments outside of a post page

I've been having difficulties with some new functionality I've been trying to create. Basically I have a custom page setup that displays a list of all posts with a specific tag. What it needs to do is ...
2
votes
4answers
2k views

get attachments for all posts of particular post type

I'm making a widget that shows a set of images from recent custom posts. I want to run the following query: SELECT p.* FROM wp_posts p WHERE post_type='attachment' AND post_mime_type LIKE 'image%' ...
0
votes
1answer
303 views

SQL: Search query to get attachments only of those parents which are published

i'm having some problem creating nice 1 query to be able to get search results which includes NOT only post_type POST but also attachments. BUT if search query return attachment, i want that it won't ...
5
votes
1answer
5k views

Get all image from single page using this query

I'm having some trouble with this sample widget code. I want to get all images (Minus the post thumbnail) from a page called "Gallery" but for some reason this is pulling all uploaded images from the ...