I was wondering if you guys knew of a way to get feedwordpress to pull in the thumbnail/featured image with posts. The default method seems to skip that aspect and it's annoying. Thanks!
Use a Yahoo!Pipe to filter your feeds and rewrite them the way that you want, then write your own plugin. I have found that FeedPress is sadly lacking in a lot of things.
I am checking out Yahoo!Pipe right now, doesn't seem exactly what I need, but it looks like a nice application. I found a basic issue with my problem, the RSS feed wasn't even putting the "featured image" into the feed, so I threw it in with this code: // THIS INCLUDES THE THUMBNAIL IN OUR RSS FEED function insertThumbnailRSS($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'alt' => get_the_title(), 'title' => get_the_title() ) ) . '' . $content; } return $content; } Code (markup): And that does put a thumbnail in my feed, but the problem is it's 150x150 and then it shows up on my other blog, it's 125x125 which is the size I set my thumbnails to in the media section. On my original page, I used this code to display my thumbnail: <?php echo get_the_post_thumbnail( $id, array(550,829) ); ?> Code (markup): Is there a way I can add that code to the RSS feed so it'll be 550x829? Thanks
Look at how to specify additional custom sizes in a blog post (second half of this article discusses it). You would want to set a custom image size via add_image_size to your functions file, or the plugin file, and use that where appropriate.
That's not working for what I need What would work for me perfectly is if I can find a way to get rid of the default height/width tags in the RSS feed. Looking at my feed, I got a thumbnail in it, and was able to manually enter 500 height, but because it has the default 125x125 first, it reads that... <img width="125" height="125" src="..." class="..." alt="..." title="..." height="550" /> Code (markup): that comes from this get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'alt' => get_the_title(), 'title' => get_the_title(), 'height' => 550) ) Code (markup): I have no idea how to remove the first height width tags
It should work. Did you create a custom image size in your functions.php file? Did you use that custom size for your get_the_post_thumbnail call? In functions.php add_image_size( 'feed-thumbnail', 9999, 550 ); // Max 550 height, unlimited width Code (markup): Wherever you grabbed that feed code before: get_the_post_thumbnail( 'feed-thumbnail'); Code (markup):
Ahh there we go! I think the problem was I wasn't linking 'feed-thumbnail' from get_post_thumbnail to add_image_size. Now I just have to tinker with excerpts and stuff. Thanks a ton!
No problem. This is a common approach in most Php scripting and WordPress ain't no different. Define a function handle ('feed-thumbnail'), use that handle.
Do you know a code that would link the thumbnail image to the permalink with this? $content = '<div>' . get_the_post_thumbnail($post->ID, 'feed-thumbnail' ) . '</div>' . $content; Code (markup): Thanks for all your help today!
Um. Maybe get_permalink() is a good place to start. LOL. Dude it is right above the $content staring you in the face!
I was wondering if there was a simple way to add that to the line to make the thumbnail link to the permalink though something like $content = '<div>' . get_permalink(). get_the_post_thumbnail($post->ID, 'feed-thumbnail' ) . '</div>' . $content; Code (markup): But I don't think that would link the thumbnail to permalink. going to check it out in a min though
Ahh, feels good to actually figure something out I got this line to work: $content = '<div>' . '<a href='. get_permalink() . '>' . get_the_post_thumbnail($post->ID, 'feed-thumbnail' ) . '</a>' . '</div>' . $content; Code (markup): The only issue I seem to have now is this: add_image_size( 'feed-thumbnail', 250, 333, true ); Code (markup): that is making it so the edges don't exceed either value, but then resizing after that. Is there a way to force the 250x333 on the images?
Those are upper limit values. If the ratio is not that same, then you would not want it to resize to 250x333. You can stop the cropping from happening by setting the fourth value to false.