WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Sitewide Tags Pages
[resolved] Showing image attachments from sub site posts (2 posts)

  1. jw60610
    Member
    Posted 1 year ago #

    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

    http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    SWT does not copy the images with the posts. It stores a copy of the thumbnail html.

    You could write a plugin that caches the result of that query and saves it with/attaches it to the SWT post.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic