Forums

Show extra HTML in RSS Post but not on the website. (6 posts)

  1. derekfreeze
    Member
    Posted 4 months ago #

    I'm not sure if what I am trying to do is possible, but it is worth a shot. I want to be able to embed things into my post and the 'extras' to be shown exclusively in my RSS feed. If you need any more details I can provide. I don't know much about WordPress, but I do know that the sky is the limit with this amazing software.

    Thanks in advance and God bless!

    Derek Freeze
    Chief Web Designer
    http://www.dailyrevolution.tv

  2. stvwlf
    Member
    Posted 4 months ago #

    Answer is yes.

    Here is an article, not exactly what you are after I think but will start you on the right path

    http://www.wpbeginner.com/wp-tutorials/how-to-add-content-and-completely-manipulate-your-wordpress-rss-feeds/

    If you mean sections of content within the post itself, I would approach it by creating or finding a short code that you wrap around the editor text that only displays in feeds. Along this line:

    Here is a sentence everyone can read. [rss]Here is a sentence only seen by feed readers.[/rss] Here is another sentence everyone can read.

    That code is NOT GOING TO WORK AS IS. You have to find or create a shortcode.

  3. derekfreeze
    Member
    Posted 4 months ago #

    I need to know how to add the code so i can use [rss] [/rss]. Can you help me write that?

  4. stvwlf
    Member
    Posted 4 months ago #

    I just quickly adapted this from a "show content to logged in users only" shortcode I found while Googling. In other words, its not tested. I think it will work however. Put this in your theme's functions.php file

    Then you should be able to use [rss]feed only content here[/rss] in your posts and pages

    add_shortcode( 'rss', 'my_feed_only_content' );
    function my_feed_only_content( $atts, $content = null ) {
       if ( is_feed() && !is_null( $content )  )
          return $content;
       return '';
    }
  5. derekfreeze
    Member
    Posted 4 months ago #

    Okay, that code works for text, but it doesnt allow me to embed a video straight into the rss :/

  6. stvwlf
    Member
    Posted 4 months ago #

Reply

You must log in to post.

About this Topic