Best Way to Create Post Only for Your RSS Subscribers

Add Tool

Create Post Only for your RSS Subscribers


Create Post Only for your RSS Subscribers

If you would like to give an exclusive offer to your regular RSS subscribers, here’s a nice trick to create a post that is only visible to your RSS subscribers.

First of all, create a category that will hold posts to show to your RSS suscribers. For example, create a category ‘RSS’ and add some posts exclusively to it. Note down the category ID of this category. Now in your theme’s functions.php file, add these lines of code so that it is only shown to RSS subscribers.

Post Only RSS Subscribers Wordpress Snippets

<?php
function excludeCategory($query)
{
	if($query->is_home | $query->is_archive )
	//Exclude category from all other pages except RSS
	$query->set('cat','-3');
	return $query;
}
add_filter('pre_get_posts', 'excludeCategory');
?>

Source


Tags: Track Rss Subscribers, Most Rss Subscribers, RSS, Subscribers, WordPress subscriber, WordPress, WordPress post, functions.php, exclude Category, exclusive offer, Regular Rss.
Payza

About Masum Billah

Create Post Only for your RSS Subscribers 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: Best Way to Create Post Only for Your RSS Subscribers


adf.ly