WordPress.org

Forums

[resolved] [WordPress MU Sitewide Tags Pages] images cannot be pulled from sub-blogs (27 posts)

  1. lameian
    Member
    Posted 4 years ago #

    i use the plugin WordPress MU Sitewide Tags Pages to pull posts from sub-blogs. text are fine however the feature images cannot be pulled. may anyone help me with this? thanks a lot.

  2. The featured image does not come through, because they aren't copied to the main blog.

    You need to use the custom_fields feature on the SWT options page and and.. thumbnail_html (I think that's it).

  3. lameian
    Member
    Posted 4 years ago #

    my theme use thiss to load the thumbnail:
    <?php the_post_image('thumbnail'); ?>

    how to integrate with custom field? instead of using the feature image function?
    thanks

  4. Try

    <?php the_post_image('thumbnail_html'); ?>

    and make sure you have the use thumbnail option checked in sitewide tags.

  5. Ron Rennick
    MultiSite Guru
    Posted 4 years ago #

    Also, the post thumbnail support is in the development version. You can find the link for that under Other Versions

  6. techunfolding
    Member
    Posted 4 years ago #

    Im having the same issue. It pulls the text from the posts just fine, but the thumbnails/featured images are not showing up. I am using the Arras theme if you needed to know that.

  7. You have to add a function to the theme to show the thumbnails that are pulled.

  8. techunfolding
    Member
    Posted 4 years ago #

    I have just tried with several themes to get the thumbnails to work. The other ones dont even use featured images. I created custom fields, thumb, thumbnail, thumbnail_html. But have had no success. Any ideas?

  9. Did you look at the SWT settings page?

  10. techunfolding
    Member
    Posted 4 years ago #

    Hi and thanks for the help,

    Yes I have looked at the settings under Super admin > Sitewide Tags. Include Post Thumbnails has been enabled but the thumbnails still are not showing.

  11. Ron Rennick
    MultiSite Guru
    Posted 4 years ago #

    You need to edit your theme or use a theme that uses the WordPress thumbnail functions. See http://wpmututorials.com/plugins/post-thumbnails-for-sitewide-tags/

  12. techunfolding
    Member
    Posted 4 years ago #

    So have been looking around for solutions and have not been able to find one that works. What I have found out is that the SWT plugin creates at custom field in the post called thumbnail_html. In that field it has the link to the featured image that was added in the sub blog. I guess my theme is then not able to use that custom field and set it as the featured image on the main site.

    Is there any way a custom field can be used to set a featured image?

  13. Did you read the post Ron linked to above? It explains how to do that.

  14. techunfolding
    Member
    Posted 4 years ago #

    Hi,

    Yes i read the link that Ron posted above. I am still just learning php so i really don't know where this <?php the_post_thumbnail(); ?> has to go. I tried several spots in the arras theme but cant seem to find a working location.

    Any ideas where i have to put it?

    Thanks.

  15. Ron Rennick
    MultiSite Guru
    Posted 4 years ago #

    Here's the codex page on the WP loop: http://codex.wordpress.org/The_Loop_in_Action

    You have to find something similar to that in your theme.

  16. IlliniCrusader
    Member
    Posted 4 years ago #

    I have read this multiple times, along with the help links here too. I am new to WP and PHP so I need a little help. I am using a WPZOOM theme (CadabraPress). I use the same theme for all blogs, including the main blog, so I assumed it would be seamless.

    Looking at the home file, it uses this code to pull the image:

    <em>[mod edit: please use pastebin for large code snippets]</em>

    Can someone give me a detailed explanation how to fix the image issue?

    Thanks for the help.

  17. Ron Rennick
    MultiSite Guru
    Posted 4 years ago #

    Per my posts above- to use SWT thumbnails your theme has to use the WP thumbnail feature/functions:

    http://wpmututorials.com/plugins/post-thumbnails-for-sitewide-tags/

  18. IlliniCrusader
    Member
    Posted 4 years ago #

    So, all I have to do is replace the current loop code with <?php the_post_thumbnail(); ?>? I have the "Include Post Thumbnails" enabled in my SWT dashboard. Is that it?

  19. Ron Rennick
    MultiSite Guru
    Posted 4 years ago #

    You need to replace your current thumbnail code in the loop with the_post_thumbnail()

    The include post thumbnails check box is only to tell SWT to get the post thumbnail html tag and save it with the post in the tags blog. It's the theme's job to output the thumbnail in the content.

  20. IlliniCrusader
    Member
    Posted 4 years ago #

    Thanks for the help Ron, I got the images to show on the main blog. My theme uses

    has_post_thumbnail()

    so I replaced it with

    the_post_thumbnail()

    Now, how do I get the image size to change - it is stuck on 150 x 150. It seems to be set from the timthumb.php file, but I can't fine the line of code that sets it at 150 x 150. Is there anything I can do to change the size?

  21. IlliniCrusader
    Member
    Posted 4 years ago #

    Never mind. I have decided to not use Sitewide Tags plugin, too much changing of the original code. I guess I'll just manually update the main blog from the other 12 blogs.

  22. Ron Rennick
    MultiSite Guru
    Posted 4 years ago #

    Glad you found something that works for you :)

  23. justarhymes
    Member
    Posted 4 years ago #

    Sorry to bump this, but my problem is sort of related. I know how to get the thumbs easy enough, but on my main site's theme (where I am directing the sub-blog posts to) I have an if else statement that posts a default image if there's no thumb.

    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php if (has_post_thumbnail()) {
    		the_post_thumbnail();
    	} else {
    	echo '<img src="'.get_bloginfo("template_url").'/images/nothumb.jpg" alt="Thumbnail" />'; }
    ?></a>

    It won't show the thumbnail like this for the sub-blogs. I've tried writing it out ways, but can't figure anything out. Is there a way to fix this?

  24. Ron Rennick
    MultiSite Guru
    Posted 4 years ago #

    has_post_thumbnail() returns false on SWT posts whether or not there is a SWT thumbnail.

    Try doing something like

    $thumb = get_the_post_thumbnail();
    if( $thumb )
    ....
    else
    ...
  25. justarhymes
    Member
    Posted 4 years ago #

    Ohhh! I had tried something like that, but didn't define it first. This worked perfectly, thanks!

  26. rikroukens
    Member
    Posted 4 years ago #

    Hey Ron and justarhymes,

    sorry to dig up this old post but i believe i have the same issue as justarhymes had, except i dont know how to fix it correctly.

    i have this code;

    <?php if ( has_post_thumbnail() ) { ?>
    									<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('thumbnail-home', array('title' => get_the_title())); ?></a>
    								<?php } else { ?>
    									<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/thumbnails/thumbnail-home.jpg" width="290" height="125" alt="<?php the_title_attribute(); ?>" /></a>

    It looks alot like justarhymes his code.

    how would i put that in with the code ron gave me?

    like this? ;

    $thumb = get_the_post_thumbnail();
    if( $thumb )
    
    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('thumbnail-home', array('title' => get_the_title())); ?></a>
    
    else
    
    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/thumbnails/thumbnail-home.jpg" width="290" height="125" alt="<?php the_title_attribute(); ?>" /></a>

    Thanks in advance, would help me out alot if i manage to get this to work.

  27. Ron Rennick
    MultiSite Guru
    Posted 4 years ago #

    As I said above

    has_post_thumbnail() returns false on SWT posts whether or not there is a SWT thumbnail.

    So, with your code you will always get the default thumbnail you have on SWT posts.

    The second snippet should work if you include the appropriate braces and openong/closing php tags.

Topic Closed

This topic has been closed to new replies.

About this Topic