If your current feed is using the code from the second tutorial, that is probably overwriting anything coming from this plugin. You could be experiencing a caching issue, as RSS feeds are notoriously difficult to test and refresh.
Can you clarify the current state of your modifications to your feed? I’m not sure which option you used from my tutorial, or if that’s still in effect at all, or if you are using the second tutorial (which I do think would override the plugin).
Also, if you can share the link to your RSS feed, I may be able to offer more insight as to what’s going on.
Yes, current feed is using code from the second tutorial, which I had added to functions.php. I removed that a while ago, but it persists.
Currently the only modifications to the feed that are not from your plugin are a few that you suggested for functions.php, that came either from your blog or from other comment threads on the plugin here at ww.wp.xz.cn:
send_images_rss_excerpt_read_more,
send_images_rss_email_image_style, and
send_images_rss_other_image_style
none of which seem to be doing anything either. 🙁
Feed is https://thesavvydiabetic.com/feed
Thanks for the reply.
Can you share the functions you’re using to modify the feed? Specifically the one on the send_images_rss_excerpt_read_morefilter.
In your raw feed, I see the plugin at work. The images are being output in the description at what looks like the MailChimp named size (560px wide), aligned center. The excerpt is being processed correctly, but there is no link in the description at all. This could be explained if you are using the code snippet from the end of the first option in my tutorial–that was intended to disable the read more link from the plugin, assuming that you want to add it by hand to your MailChimp template.
If this is the code snippet you’re using in your functions.php file, you would just need to update your MailChimp template with the code shared in the tutorial (above the one to disable the read more link).
The cache must have expired. I’ve re-added the button in the MC interface and it’s good now.
Only thing left I’d like to do to the MC template at this point is some styling on the featured image it’s pulling to maybe create a little margin around it and possibly a border.
These are the functions that I got either your blog or your comments here that I’m trying to use on the image to do this, but they don’t seem to be getting applied when I check the feed validator:
//
add_filter( 'send_images_rss_email_image_style', 'rgc_email_images', 10, 2 );
function rgc_email_images( $style, $maxwidth ) {
return sprintf( 'display:block;margin:30px auto;border:1px solid #ccc;max-width:%spx;', $maxwidth );
}
//
add_filter( 'send_images_rss_other_image_style', 'rgc_change_other_images', 10, 6 );
function rgc_change_other_images( $style, $width, $maxwidth, $halfwidth, $alignright, $alignleft ) {
$style = sprintf( 'display:block;margin:30px auto;border:1px solid #ccc;max-width:%spx;', $maxwidth );
if ( $width < $maxwidth ) {
$style = sprintf( 'maxwidth:%spx;', $halfwidth );
}
return $style;
}
Thanks again, Robin
Those two filters are for images in the full post content, which is why you’re not seeing the changes you want to see. Since your feed is set for summaries, you want something like this instead, on the send_images_rss_excerpt_image_style:
add_filter( 'send_images_rss_excerpt_image_style', 'prefix_modify_excerpt_image_style', 10, 3 );
/**
* Modify the image style for RSS excerpts.
*
* @param $style
* @param $alignment
* @param $margin
*
* @return string
*/
function prefix_modify_excerpt_image_style( $style, $alignment, $margin ) {
if ( 'center' === $alignment ) {
return 'display:block;margin:30px auto;border:1px solid #ccc;';
}
return $style;
}
I have not tested this, but I think this should be what you need. Since your feed is set to summaries, you can remove the other two filters.
Sorry for the confusion–hope this helps!
OK thanks Robin. I’ve added the new code here but probably have to wait again for cache to expire. I don’t see it showing up yet in the validator. Will check again tomorrow.
Appreciate the help.