Last active
February 4, 2016 09:59
-
-
Save ThomasKujawa/4b848dacdec2ddaa6dd2 to your computer and use it in GitHub Desktop.
Wordpress | Toolbox | Featured Images automatisch im WordPress Feed anzeigen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Module Name: Featured Images automatisch im WordPress Feed anzeigen | |
Module URI: http://wp-ezine.com/featured-images-automatisch-im-wordpress-feed-anzeigen_469900.html | |
Description: fügt die Featured Images zum RSS Feed hinzu [Frontend] | |
Author: Karl-Heinz Klug | |
Author URI: http://wp-ezine.com/author/karl | |
*/ | |
/* Sicherheitsabfrage */ | |
if ( !class_exists('Toolbox') ) { | |
die(); | |
} | |
/* Ab hier kann's los gehen */ | |
if ( ! function_exists( 'wpez_rss_post_thumbnail' ) ) { | |
function wpez_rss_post_thumbnail($inhalt) { | |
global $post; | |
if(has_post_thumbnail($post->ID)) { | |
$inhalt = get_the_post_thumbnail($post->ID) . $inhalt; | |
} | |
return $inhalt; | |
} | |
} | |
add_filter('the_excerpt_rss', 'wpez_rss_post_thumbnail'); | |
add_filter('the_content_feed', 'wpez_rss_post_thumbnail'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment