$10
Feedburner RSS not showing images from posts
Website: http://windows7design.com/
I add there images using custom field: preview images are: post-img
Then: http://feeds.feedburner.com/Windows7Design
is not showing that images
coxis | 02/15/10 at 7:41am
| Edit
(5) Possible Answers Submitted...
-

Last edited:
02/15/10
7:48amJaph says:The reason your images are not appearing in the RSS feed is because they are in a custom field and not a core part of the post, so your RSS feed doesn't know about them.
You can work around this with a plugin called
Custom Fields For Feeds
If you need more assistance on how to use this plugin other than what's on that site, there's also a blog post here that explains how to use it for images: Custom Field Images in WordPress Feeds
I hope that helps :)- 02/15/10 7:51am
coxis says:Well i saw that plugin on google and tried to make it work but my main question was for whole answer, i mean to find a solution (working) for my site.
- 02/15/10 8:03am
coxis says:if you need i can provide you proper access to my server
- 02/15/10 9:34am
coxis says:I tried the solution from your link, but still nothing on my RSS.
I've changed:
$image = get_post_meta($post->ID, 'POST_IMAGE_URL', $single = true);
to:
$image = get_post_meta($post->ID, 'post-img', $single = true);
upload that: http://coffee2code.com/wp-plugins/get-custom-field-values/
but still no images in my RSS
- 02/15/10 7:51am
-

Last edited:
02/15/10
12:24pmkjll kll says:Quick solution...
try this:
Use your "meta" image as you did it before but,
put it inside the posting as a core part too like that:
<img href="IMAGEURL" class="myrssimg" />
Now add the following line to the css file of your theme
.myrssimg
{
display: none;
}
Now if someone is having a look at the rss feed the image is shown, but if someone does look at the actual homepage the image is hidden...
- 02/15/10 12:52pm
coxis says:No good, i will need to edit all posts ! to apply this one..
- 02/15/10 1:03pm
kjll kll says:Normaly rss feeds are mainly used for future posts ... so... but i'll have a lok for another solution if I'm at home
- 02/15/10 1:04pm
coxis says:cool, tnx
what is strange .. that author of this theme (coder) put the same stuff with custom field images on other site and there RSS is ok - 02/16/10 5:09am
kjll kll says:Add this to your functions.php
function cf_addtorss($content) {
global $wp_query;
$postid = $wp_query->post->ID;
$post_image_url = get_post_meta($postid, 'POST_IMAGE_URL', true);
if(is_feed()) {
if($post_image_url !== '') {
$content = "<p><img src='".$post_image_url."' /></p>".$content;
}
else {
$content = $content;
}
}
return $content;
}
add_filter('the_excerpt_rss', 'cf_addtorss');
add_filter('the_content', 'cf_addtorss');
- 02/16/10 5:09am
kjll kll says:This works for me
- 02/16/10 5:46am
coxis says:i've added your code to functions.php
rss is there , but without images !
the best code was erez213 , but there was problem with:
this is the problem: url to image:
http://feeds.feedburner.com/img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg
and it should be: http://windows7design.com/img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg
- 02/16/10 6:08am
kjll kll says:What is the meta key of the images?
post-img
or
POST_IMAGE_URL
?
And, is the solution erez213 added still active? - 02/16/10 6:10am
coxis says:post-img is custom field for preview images
but i change yours:
function cf_addtorss($content) {
global $wp_query;
$postid = $wp_query->post->ID;
$post_image_url = get_post_meta($postid, 'post-img', true);
if(is_feed()) {
if($post_image_url !== '') {
$content = "<p><img src='".$post_image_url."' /></p>".$content;
}
else {
$content = $content;
}
}
return $content;
}
add_filter('the_excerpt_rss', 'cf_addtorss');
add_filter('the_content', 'cf_addtorss');
- 02/16/10 6:18am
coxis says:i don't know WTF is going on, it was working this morning with wrong URL to image, but it was working, now i cannot see images with wrong URL, the code is the same .. don't know how the hell put this to work
- 02/16/10 6:39am
kjll kll says:Are you using full posts or excerpts for the rss feed?
- 02/16/10 6:41am
coxis says:ok it is working one more time:
http://feeds.feedburner.com/Windows7Design
i use full post
to put this to work i change some option in http://feedburner.google.com/ setup
i think not the option is important, but only that i've change something there it start working with @erez213 code, now the only thing that is wrong is:
url to image:
http://feeds.feedburner.com/img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg
and it should be: http://windows7design.com/img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg
- 02/16/10 8:25am
kjll kll says:The meta key... do you insert the complete url (with http:/www.http://windows7design.com/) or just
img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg
??? - 02/16/10 8:42am
coxis says:only: img/image.jpg
can we fix that ? image is there but with wrong URL :/ - 02/16/10 8:47am
coxis says:didn't see that erez213 wrote here with new version, will check that out
- 02/16/10 8:49am
kjll kll says:Search for (functions.php):
$img = '<img src="'.get_post_meta(get_the_ID(), 'post-img', $single = true).'" alt="'.get_the_title().'" /><br />';
replace with
$img = '<img src="http://windows7design.com/'.get_post_meta(get_the_ID(), 'post-img', $single = true).'" alt="'.get_the_title().'" /><br />';
- 02/16/10 9:21am
coxis says:done that, i am waiting to see if that works !
tnx - 02/16/10 9:57am
coxis says:ok everything is working
now i have a big problem, should who i picked
you or erez213 who gave the code in first place, but you also help me alot with resolving this one
Christian , you are going to be mad if I give $ to erez213
there should be a option to split the money
- 02/15/10 12:52pm
-

Last edited:
02/16/10
1:05pmErez S says:put the following code in your functions.php file in your theme folder:
function insert_img($content) {
$img = '<img src="'.get_post_meta(get_the_ID(), 'post-img', $single = true).'" alt="'.get_the_title().'" /><br />';
$content = $img.$content;
return $content;
}
add_filter('the_excerpt_rss', 'insert_img');
add_filter('the_content_rss', 'insert_img');
that sholud work
- 02/15/10 5:03pm
coxis says:erez213 please post full functions.php file for me
<?php
/**
* @package WordPress
* @subpackage Windows7Styles_theme
*/
automatic_feed_links();
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name'=>'Left',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
register_sidebar(array(
'name'=>'Right',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
}
?>
i will then swap it and check if that works
- 02/16/10 3:37am
coxis says:http://feeds.feedburner.com/Windows7Design
not ideal but something is going on - 02/16/10 4:40am
coxis says:this is the problem: url to image:
http://feeds.feedburner.com/img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg
and it should be: http://windows7design.com/img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg - 02/16/10 8:31am
Erez S says:<?php
/**
* @package WordPress
* @subpackage Classic_Theme
*/
automatic_feed_links();
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '',
'after_title' => '',
));
function insert_img($content) {
$img = '<img src="'.get_post_meta(get_the_ID(), 'post-img', $single = true).'" alt="'.get_the_title().'" /><br />';
$content = $img.$content;
return $content;
}
add_filter('the_excerpt_rss', 'insert_img');
add_filter('the_content_rss', 'insert_img');
?>
That should work(fix the image url).
Enjoy - 02/16/10 8:34am
Erez S says:My bad,this is the right code:
<?php
/**
* @package WordPress
* @subpackage Windows7Styles_theme
*/
automatic_feed_links();
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name'=>'Left',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
register_sidebar(array(
'name'=>'Right',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
}
function insert_img($content) {
$img = '<img src="'.get_option('siteurl').'/'.get_post_meta(get_the_ID(), 'post-img', $single = true).'" alt="'.get_the_title().'" /><br />';
$content = $img.$content;
return $content;
}
add_filter('the_excerpt_rss', 'insert_img');
add_filter('the_content_rss', 'insert_img');
?> - 02/16/10 8:55am
coxis says:i am here, just upload the newest version of your code, waiting for RSS update to see if this work, keep my fingers crossed
http://feeds.feedburner.com/Windows7Design - 02/16/10 9:18am
coxis says:sorry but the problem is still there: http://feeds.feedburner.com/Windows7Design
- 02/16/10 9:25am
Erez S says:That should work for sure:
<?php
/**
* @package WordPress
* @subpackage Windows7Styles_theme
*/
automatic_feed_links();
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name'=>'Left',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
register_sidebar(array(
'name'=>'Right',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
}
function insert_img($content) {
$img = '<img src="'.get_bloginfo('template_url').'/'.get_post_meta(get_the_ID(), 'post-img', $single = true).'" alt="'.get_the_title().'" /><br />';
$content = $img.$content;
return $content;
}
add_filter('the_excerpt_rss', 'insert_img');
add_filter('the_content_rss', 'insert_img');
?> - 02/16/10 9:57am
Erez S says:i see that my solution had worked , enjoy :)
- 02/16/10 10:00am
coxis says:like Christian said i post static src to template img folder
but now i switch that to your code
anyway i want to tnx you for helping and give this small award to you, i just asked Christian if he is ok with that, because he also helped me alot
tnx for putting this to work !!!
one more question, so i don't need to use plugin: Custom Fields for Feeds & Get Custom Field Values , only your code yes - 02/16/10 10:05am
Erez S says:no,only my code
- 02/16/10 10:54am
coxis says:i am going to kill myself really
i've changed from summary to full RSS and images gone away:
http://feeds.feedburner.com/Windows7Design
what i've done more is delete those 2 plugins...
what more i don't know, i've lost image, don't know really what happaned - 02/16/10 11:25am
Erez S says:if you switch to sumarry,the images will back?
- 02/16/10 11:29am
Erez S says:and if it still dont work,try to install those plugins again
- 02/16/10 11:55am
coxis says:when i put it to summary images come back !
- 02/16/10 12:01pm
coxis says:everything would be good with only summary: http://feeds.feedburner.com/Windows7Design
but the test , post is not formatted at all
it is only formatted when i use full post - 02/16/10 12:43pm
Erez S says:<?php
/**
* @package WordPress
* @subpackage Windows7Styles_theme
*/
automatic_feed_links();
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name'=>'Left',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
register_sidebar(array(
'name'=>'Right',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
}
function insert_img($content) {
if(is_feed()){
$img = '<img src="'.get_bloginfo('template_url').'/'.get_post_meta(get_the_ID(), 'post-img', $single = true).'" alt="'.get_the_title().'" /><br />';
$content = $img.$content;
}
return $content;
}
add_filter('the_excerpt_rss', 'insert_img');
add_filter('the_content', 'insert_img');
?>
try this with full content - 02/16/10 1:03pm
coxis says:it is working great !
tnx
- 02/15/10 5:03pm
-

Last edited:
02/15/10
4:00pmAlwyn Kotze says:Hi
Your feed seems to be set to show an excerpt in stead of full content so the images will not show.
I wrote a small script that gets the first or last image uploaded with your post to show automatically instead of using custom fields. This should be a remedy as it will do everything automatically for you. This also works with timthumb so you have maximal control over the outlay in your posts and category pages.
BUT
The problem that you are experiencing seems more of a settings issue than a layout issue.
Send me details and I can assist.Previous versions of this answer: 02/15/10 at 4:00pm
- 02/15/10 5:04pm
coxis says:hmm that sound great
but i've change the excerpt to full post, before it was a full post and it doesn't work also so i don't think this was this kind of problem
- 02/15/10 5:04pm
-

Last edited:
02/15/10
9:56pmAli Hussain says:this is the edited functions.php, additions as like erez213, so you can like pay him :) I am glad i helped make things faster
<?php
/**
* @package WordPress
* @subpackage Windows7Styles_theme
*/
automatic_feed_links();
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name'=>'Left',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
register_sidebar(array(
'name'=>'Right',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));
}
function insert_img($content) {
$img = '<img src="'.get_post_meta(get_the_ID(), 'post-img', $single = true).'" alt="'.get_the_title().'" /><br />';
$content = $img.$content;
return $content;
}
add_filter('the_excerpt_rss', 'insert_img');
add_filter('the_content_rss', 'insert_img');
?>
Works for me, tested on my local server with the img code.
Previous versions of this answer: 02/15/10 at 9:56pm
- 02/16/10 3:37am
coxis says:something is there, but not ideal:
http://feeds.feedburner.com/Windows7Design - 02/16/10 4:40am
coxis says:this is the problem: url to image:
http://feeds.feedburner.com/img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg
and it should be: http://windows7design.com/img/Leopard_Dark_for_Windows_7_by_sagorpirbd.jpg - 02/16/10 5:15am
coxis says:yes now RSS is not working at all: http://feeds.feedburner.com/Windows7Design
- 02/16/10 8:58am
Ali Hussain says:I think, i may know the problem, can i have the source code for index.php please
- 02/16/10 3:37am
This question has expired.
Current status of this question: Completed





