SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | ||
3 | /** | |
4 | * Añade la imagen destacada al RSS | |
5 | * Este tema no necesita esta feature, ya que al no incluir en la pagina | |
6 | * de post la featured image la he de poner a mano | |
7 | */ | |
8 | function imagenDestacadaEnRSS($content) { | |
9 | global $post; | |
10 | if ( has_post_thumbnail( $post->ID ) ){ | |
11 | - | $content = '<div>' . get_the_post_thumbnail( $post->ID, 'large', array( 'style' => 'float:none; text-align: center; margin-bottom: 15px;' ) ) . '</div>' . $content; |
11 | + | $content = get_the_post_thumbnail( $post->ID, 'thumbnail', |
12 | array( 'style' => 'float: left; margin-right: 15px; margin-bottom: 15px;' ) ) . $content; | |
13 | } | |
14 | return $content; | |
15 | } | |
16 | ||
17 | add_filter('the_excerpt_rss', 'imagenDestacadaEnRSS'); | |
18 | add_filter('the_content_feed', 'imagenDestacadaEnRSS'); | |
19 | ||
20 | ?> |