Greetings,
You may want to use the wpba_attachment_list function instead. You can find more information on the github repo.
You could also try get_children( array( 'post_type' => 'attachment' ) ); and see if it retrieves anything.
Please let me know if you have any questions.
Thanks,
Dan
Dan,
New to WordPress development, so I really appreciate the quick reply. Here is more background about the issue. The table is generated from another plugin, which I’m modifying to fit an immediate need. As mentioned, it uses a custom post_type called board_event. I’m modifying the php file that builds the board event table. After looking at MySQL, I can see the wp_posts has my post_type attachment set with the post_parent column set as the id for the event. I have also checked the wp_postmeta table and the expected entries for _wp_attached_file are there.
Below is the query string run against mySQL. I believe the inner joins are causing the issue. When viewing an individual event, the query is shown without joins and works correctly.
‘SELECT wp_posts.*
FROM wp_posts
INNER JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
INNER JOIN wp_postmeta AS mt1
ON ( wp_posts.ID = mt1.post_id )
WHERE 1=1
AND wp_posts.post_parent = 3734
AND ( wp_postmeta.meta_key = ‘_start_date_time’
AND ( ( mt1.meta_key = ‘_end_date_time’
AND mt1.meta_value > ‘1470842420’ ) ) )
AND wp_posts.post_type = ‘attachment’
AND ((wp_posts.post_status = ‘inherit’))
GROUP BY wp_posts.ID
ORDER BY wp_postmeta.meta_value+0 ASC”
Any thoughts why the additional joins are included in the query string or how to remove them?
Thanks,
Chris