Showing image attachments from sub site posts
-
Hello,
Using the Sitewide Tags plugin I am trying to show, on the main site, the first four images of posts from both the main site and more importantly the sub-sites.
I’m using
get_children()
using the following arguments:$images = new WP_Query( array( 'post_parent' => get_the_ID(), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', 'posts_per_page' => 4, 'post__not_in' => array($thumb_id), 'update_post_term_cache' => false, ) );
Then:
foreach ($images->posts as $image) { echo '<div class="gallery-image"><a href="'.get_permalink($image->ID).'">'.wp_get_attachment_image( $image->ID, 'gallery-overview-thumb' ).'</a></div>';
in the loop.
Everything works fine in posts from the main site, but on posts from any sub site, the images do not show.
Obviously the issue relates to how Sitewide Tags displays attachments from sub sites, but I’m lost as to a solution.
Any help is appreciated. Thanks so much.
Jim
https://www.ads-software.com/extend/plugins/wordpress-mu-sitewide-tags/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Showing image attachments from sub site posts’ is closed to new replies.