Advertisement
websupporter

Add a Tag into WordPress' RSS Feed

Mar 7th, 2016
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.     /**
  3.      * Plugin Name: Extend RSS2 Feed
  4.      * Author: Websupporter
  5.     **/
  6.  
  7.     add_action( 'rss2_item', 'erf_rss2_item' );
  8.     function erf_rss2_item(){
  9.         $farbe = get_post_meta( get_the_ID(), 'farbe', true );
  10.         if( ! $farbe )
  11.             return;
  12.         ?>
  13.         <farbe:wert><?php echo $farbe; ?></farbe:wert>
  14.         <?php
  15.     }
  16.  
  17.     add_action( 'rss2_ns', 'erf_rss2_ns' );
  18.     function erf_rss2_ns(){
  19.         ?>
  20.         xmlns:farbe="http://websupporter.net/ns/farbe/"
  21.         <?php
  22.     }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement