Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // These functions could go into the functions.php in your theme, or form
- // part of another plugin.
- /**
- * Hooks the WP wp_rss_image_size filter
- *
- * @param
- * @return void
- **/
- function sw_wp_rss_image_size( $size ) {
- $size = 'large-feature';
- return $size;
- }
- add_filter( 'wp_rss_image_size', 'sw_wp_rss_image_size' );
- /**
- * Hooks the WP wp_rss_image_alternative filter
- *
- * @param
- * @return void
- **/
- function sw_wp_rss_image_alternative( $false, $post_id ) {
- $post = get_post( $post_id );
- $img_url = $false;
- if ( $thumbnail_id = get_post_thumbnail_id( $post->ID ) ) {
- $img = wp_get_attachment_image_src( $thumbnail_id, 'small-feature' );
- $img_url = $img[ 0 ];
- }
- return $img_url;
- }
- add_filter( 'wp_rss_image_alternative', 'sw_wp_rss_image_alternative', 10, 2 );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement