Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$30
Wordpress Multisite RSS Thumbnail
I've created a Wordpress Network with subdomains.
another.no
anothertest.no
I want all the new posts from the network to appear on another.no; as a start page and kind of a collection of all the new posts from around the whole network.
I need someone to do this for me/help me. It is also necessary for me to get the Featured Image from the sub doman blogs on a thumbnail in antother.no's start page.
(Now I have installed FeedWordpress, and all the posts from the network appears on another.no, but the Featured Image is not transmitted over.)
Skype: sondreroe
sdr | 01/07/12 at 10:29am
Edit
Previous versions of this question:
01/07/12 at 10:38am
| 01/07/12 at 10:41am
| 01/07/12 at 11:20am
(4) Possible Answers Submitted...
Note: sdr felt their question was unanswered, so we granted them a refund.
Note: sdr requested a refund. They offered this explanation:
"http://another.no/(Only posts via FeedWordpress)
I have entered the codes that Jurre Hanema gave me to include the featured images that is connected to FeedWordpress. It resulted in a problem with the image height. It is like the images height is not included, only the text.
(It is not a problem with the theme: here is the same theme, but with original posts (not via RSS): http://thai.another.no/)
Somebody know what I can do for including the image height for the Featured Images from the RSS-feed?"
If no one challenges a refund request, then they are automatically granted and proccessed after 48 hours. Admins of this site only review refund requests if someone challenges the request. If you are curious about how we handled previous refund requests, you may read over all refund requests and their challenges.
See a chronological view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
01/07/12
10:50amFrancisco Javier Carazo Gil says:Hi sdr,
In FeedWordPress, in feeds-page.php from line 891 you have the code that show the feeds. In this code you have:
<h3>Sample Item</h3>
<ul>
<li>Title: <a href="<?php echo $post->post['meta']['syndication_permalink']; ?>"><?php echo $post->post['post_title']; ?></a></li>
<li>Date: <?php print date('d-M-y g:i:s a', $post->published()); ?></li>
</ul>
<div class="entry">
<?php print $post->post['post_content']; ?>
</div>
You have to add another one:
if($rss_url == "one_site)
echo "<img src='your_thumbnail'/>";
else
echo "<img src='your_other_thumbnail'/>";
Remember to change the name of plugin to prevent problems updating and if you want, upload the new plugin improved respecting license and mentioning the original one.- 01/07/12 11:04am
sdr says:Don't work? Have I done something wrong in the pasting?
- 01/07/12 11:08am
Francisco Javier Carazo Gil says:sdr you have to:
1. Set the real value of your thumbs
2. Find something in $rss object that gives you the URL (I think $rss_url is not visible from there)
3. Put the img exactly where you want it appears - 01/07/12 11:12am
Francisco Javier Carazo Gil says:Sdr
I go out now, if I can I continue helping you but I'm not sure I'm going to have network.
Regards. - 01/07/12 11:20am
sdr says:I need you/someone to do this for me. Because I'm stupid.
- 01/07/12 12:53pm
Francisco Javier Carazo Gil says:Sdr,
If you want a plugin you can use: http://www.plugpress.com/plugin/wp-recent-network-posts.
If you prefer continuing with other option, I have seen code and I tell you:
1. Set the real value of your thumbs
The real values of your thumbs should be something like: "/images/site_1_thumb.png"
2. Find something in $rss object that gives you the URL (I think $rss_url is not visible from there)
I have seen the code of the class and it is: $post->link, here you can obtain the blog URL and make the if statement.
3. Put the img exactly where you want it appears.
For example here:
<h3>Sample Item</h3>
<ul>
<li>Title: <a href="<?php echo $post->post['meta']['syndication_permalink']; ?>"><?php echo $post->post['post_title']; ?></a></li>
<li>Date: <?php print date('d-M-y g:i:s a', $post->published()); ?></li>
</ul>
<div class="entry">
<img src="<?php echo $mythumb?>"/>
<?php print $post->post['post_content']; ?>
</div>
- 01/07/12 11:04am
-

Last edited:
01/07/12
11:38amArnav Joy says:can you explain more as I did not got you?
Sorrry!!!!- 01/07/12 11:44am
Arnav Joy says:are you using this plugin
http://wordpress.org/extend/plugins/feedwordpress/
?? - 01/07/12 11:52am
Arnav Joy says:if you are using this plugin then open feeds-page.php
and
find out this line(line no. 889)
$post = new SyndicatedPost(array('simplepie' => $rss->originals[0], 'magpie' => $rss->items[0]), $link);
after that line
write following
print_r($post);
and tell me what is the output? - 01/07/12 11:53am
sdr says:Yes. And I need FeedWordpress to inlcude the Featured Image of the posts too. Not only the text.
- 01/07/12 12:00pm
sdr says:Where can I find the output? Sorry, I'm new to php. If you have Skype we can talk there and you can get access to my server, so you can try to fix it?
- 01/07/12 12:02pm
Arnav Joy says:ok give me access to your server
at thearnavjoy@gmail.com - 01/07/12 12:19pm
Arnav Joy says:add me on skype as arnav.joy please send me request.
- 01/07/12 1:29pm
Arnav Joy says:did you checked the checkbox at
network admin -> dashboard -> settings -> upload settings ->
check the images, videos, ..
- 01/07/12 11:44am
-

Last edited:
01/07/12
12:28pmphilip says:If you want to do this entirely with a plugin and no code changes:
http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/
you have the option of pushing posts to your main site (the mother site) or to another site
e.g. news.mysite.com created on your multisite network
i find it works well, and you can delete or demote entries from the news site if you like, preserving the posts from your network sitesPrevious versions of this answer: 01/07/12 at 12:28pm
-

Last edited:
01/07/12
12:38pmJurre Hanema says:It's not so difficult to get an RSS feed to include the featured image of a post. What is more difficult is to transfer it over to another.no. Therefore I propose a solution using FeedWordpress's "Custom Post Settings". For this to work you will need to modify the posts loop at another.no.
As a first step, add this code to the functions.php of every site on your network:
add_action('rss2_ns', 'wpq_rss2_ns');
add_action('rss2_item', 'wpq_rss2_item');
function wpq_rss2_ns()
{
echo "xmlns:wpq=\"http://www.wpquestions.com/question/show/id/3663/\"\n";
}
function wpq_rss2_item()
{
if($id = get_post_thumbnail_id())
{
$attachment = wp_get_attachment_image_src($id);
if($attachment)
echo '<wpq:thumbnail>'.$attachment[0].'</wpq:thumbnail>';
}
}
This code will include the featured images in the RSS feed.
Then, at another.no and possibly your other sites go to the Wordpress admin and navigate to Syndication -> Posts & Links and find the box titled "Custom Post Settings (to apply to each syndicated post)". In the field Key enter "syndication_thumbnail" and in the field Value enter "$(wpq:thumbnail)". Save the settings.
This will tell FeedWordpress to save the URL to the featured image in a custom field called "syndication_thumbnail".
Now you need to modify the posts loop at another.no so that it actually shows these images. If you need further help with this, please post the code you are using now.Previous versions of this answer: 01/07/12 at 12:38pm
- 01/07/12 12:55pm
sdr says:I've added the code to functions.php, and edited the settings in Synication at another.no.
Do I have to install the FeedWordpress plugin on all the subdomains?
Here is the code for my loop:
<?php if ( ! have_posts() ) : ?>
<div id="post-0" class="post error404 not-found">
<h1 class="entry-title"><?php _e( 'Not Found', 'imbalance2' ); ?></h1>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'imbalance2' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</div><!-- #post-0 -->
<?php endif; ?>
<h4>Siste blogginnlegg fra nettverket</h4>
<?php $imbalance2_theme_options = get_option('imbalance2_theme_options') ?>
<div id="boxes">
<?php while ( have_posts() ) : the_post(); ?>
<div class="box">
<div class="rel">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('homepage-thumb', array('alt' => '', 'title' => '')) ?> </a>
<?php if ($imbalance2_theme_options['images_only'] == 0): ?>
<div class="categories"><?php imbalance2_posted_in(); ?></div>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<?php the_excerpt() ?>
<div class="posted"><?php imbalance2_posted_on() ?> <span class="main_separator">/</span>
<?php echo comments_popup_link( __( 'No comments', 'imbalance2' ), __( 'One Comment', 'imbalance2' ), __( '% Comments', 'imbalance2' ) ); ?>
</div>
<?php endif ?>
<div class="texts">
<?php if ($imbalance2_theme_options['images_only'] == 1): ?>
<a class="transparent" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('homepage-thumb', array('alt' => '', 'title' => '')) ?></a>
<?php endif ?>
<div class="abs">
<?php if ($imbalance2_theme_options['images_only'] == 0): ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('homepage-thumb', array('alt' => '', 'title' => '')) ?></a>
<?php endif ?>
<div class="categories"><?php imbalance2_posted_in(); ?></div>
<h1><a href="<?php the_permalink(); ?>"> <?php the_title(); ?></a></h1>
<?php the_excerpt() ?>
<div class="posted"><?php imbalance2_posted_on() ?> <span class="main_separator">/</span>
<?php echo comments_popup_link( __( 'No comments', 'imbalance2' ), __( 'One Comment', 'imbalance2' ), __( '% Comments', 'imbalance2' ) ); ?>
</div>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<?php if ( $wp_query->max_num_pages > 1 ) :
if ( $imbalance2_theme_options['navigation'] == 0 ) : // Default ?>
<div class="fetch">
<?php next_posts_link( __( 'Load more posts', 'imbalance2' ) ); ?>
</div>
<script type="text/javascript">
// Ajax-fetching "Load more posts"
$('.fetch a').live('click', function(e) {
e.preventDefault();
$(this).addClass('loading').text('Loading...');
$.ajax({
type: "GET",
url: $(this).attr('href') + '#boxes',
dataType: "html",
success: function(out) {
result = $(out).find('#boxes .box');
nextlink = $(out).find('.fetch a').attr('href');
$('#boxes').append(result).masonry('appended', result);
$('.fetch a').removeClass('loading').text('Load more posts');
if (nextlink != undefined) {
$('.fetch a').attr('href', nextlink);
} else {
$('.fetch').remove();
}
}
});
});
</script>
<?php elseif ( $imbalance2_theme_options['navigation'] == 1 ) : // Infinite scroll ?>
<div class="infinitescroll">
<?php next_posts_link( __( 'Load more posts', 'imbalance2' ) ); ?>
</div>
<script type="text/javascript">
// Infinite Scroll
var href = 'first';
$(document).ready(function() {
$('#boxes').infinitescroll({
navSelector : '.infinitescroll',
nextSelector : '.infinitescroll a',
itemSelector : '#boxes .box',
loadingImg : '<?php echo get_bloginfo('stylesheet_directory') ?>/images/loading.gif',
loadingText : 'Loading...',
donetext : 'No more pages to load.',
debug : false
}, function(arrayOfNewElems) {
$('#boxes').masonry('appended', $(arrayOfNewElems));
if (href != $('.infinitescroll a').attr('href'))
{
href = $('.infinitescroll a').attr('href');
}
});
});
</script>
<?php endif; ?>
<?php endif; ?> - 01/07/12 1:24pm
Jurre Hanema says:No, you only need to install FeedWordpress on another.no.
My modification to functions.php however, you need to add on all subdomains.
Lets take a look at your code then. Well, actually, lets forget about modifying your code because I came up with a solution that might be slightly easier to handle.
In the functions.php of another.no, add this code:
add_filter('post_thumbnail_html', 'wpq_post_thumbnail_html', 10, 5);
function wpq_post_thumbnail_html($html, $post_id, $post_thumbnail_id, $size, $attr)
{
if(!$html)
{
$url = get_post_meta($post_id, 'syndication_thumbnail', true);
if($url)
$html = '<img src="'.esc_attr($url).'"/>';
}
return $html;
}
Now, you can add a new post with featured images on anothertest.another.no and see if it works. - 01/07/12 2:15pm
sdr says:It doesn't work.
I question this code? it is a mistake?
function wpq_rss2_ns()
{
echo "xmlns:wpq=\"http://www.wpquestions.com/question/show/id/3663/\"\n";
} - 01/08/12 7:46am
Jurre Hanema says:That code is correct. It adds a new namespace to the RSS feed in which I can add the "thumbnail"-element.
Are you sure you added my first functions.php code to anothertest.another.no? Because if I go to http://anothertest.another.no/feed/, I don't see the expected output. - 01/08/12 7:57am
sdr says:Thanks! It works!
But they are not the same width. What can I do now? - 01/08/12 11:03am
sdr says:I managed to change the imagesthumbnail width through Media settings my self.
Still have a problem with the incoming posts. The posts height does not include the images. - 01/09/12 7:23am
Jurre Hanema says:I assumed that the thumbnail sizes you are using were the same across the network. If they're not, you will have to work with custom image sizes, which is just a little tiny bit more complicated.
I can see that the height of your boxes is not correct, but I think that's an issue with your theme which has nothing to do with the syndication. - 01/09/12 8:16am
sdr says:As I said I fixed the image width :-) Thats not a problem.
The only problem I have now is the height of the boxes. It is a free theme I downloaded and everything worked as it should before I inserted the new codes.
It is like the images height in the box is not included, only the text. - 01/09/12 3:24pm
sdr says:If you look here: http://thai.another.no
The exact same layou with posts only from http://thai.another.no.
- 01/07/12 12:55pm
This question has expired.
Current status of this question: Refunded
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
