Last active
September 20, 2017 23:32
-
-
Save wpscholar/1242556 to your computer and use it in GitHub Desktop.
WordPress shortcode allows you to create content that is visible only in your RSS feeds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPress shortcode allows you to create content that is visible only in your RSS feeds. | |
* | |
* Example: [feedonly]Dear RSS readers...[/feedonly] | |
*/ | |
function feedonly_shortcode( $atts, $content = null) { | |
if (!is_feed()) return ""; | |
return $content; | |
} | |
add_shortcode('feedonly', 'feedonly_shortcode'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment