Guest User

Untitled

a guest
Sep 22nd, 2023
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function custom_excerpt_in_rss($content) {
  2. global $post;
  3.  
  4. if (has_excerpt($post->ID)) {
  5. $excerpt = get_the_excerpt();
  6. $content = '<description><![CDATA[' . $excerpt . ']]></description>' . $content;
  7. }
  8.  
  9. return $content;
  10. }
  11.  
  12. add_filter('the_excerpt_rss', 'custom_excerpt_in_rss');
  13.  
Advertisement
Add Comment
Please, Sign In to add comment