Make text bigger  Make text smaller  Toggle background color  Bookmark/Share


HOW TO EDIT THE WORDPRESS RSS FEED

Edit WordPress Feed

Ever suspicion we could have a little improvements to your RSS feed? Like vouchsafing it cover some-more (or less!) content? Or adding a little additional sum onto a finish of your posts?

In this post, I’m starting to uncover we how to do usually that. Here’s what we’ll be covering:

  • How to embody both posts and pages in your feeds.
  • How to supplement thumbnails to your feeds.
  • How to exclude posts with a certain tag.
  • Set how most posts crop up in your feed (Without inspiring a rest of your site).
  • How to uncover usually posts from a certain category.
  • How to add calm to a finish of any post (e.g. couple to your latest featured post).

All of this is starting to take place in the functions.php record of your theme. If your thesis doesn’t have one, usually emanate a record in your theme’s printed matter with which name as good as let’s get to it! (Make certain all of this formula goes in between a opening tab in a file)

Include Pages in WordPress Feed

What we will do is supplement a filter to WordPress when it is acid for posts. The filter is starting to check if a posts have been for a feed, as good as if they are, it’s starting to adjust a query to embody both posts as good as pages.

function feedFilter($query) {
	if ($query->is_feed) {
		$query->set('post_type','any');
		}
	return $query;
}
add_filter('pre_get_posts','feedFilter');

If we longed for to uncover usually pages, afterwards we could shift a word ‘any’ to ‘page’ (or to a name of any law post sorts you’ve created).

You competence wish to be some-more specific as good as only uncover tip spin pages. In which case, we could have make make make use of of of of this formula with an additional line to uncover usually tip spin pages:

function feedFilter($query) {
	if ($query->is_feed) {
		$query->set('post_type','any');
		$query->set('post_parent','0');
		}
	return $query;
}
add_filter('pre_get_posts','feedFilter');

Add Thumbnails to RSS Feed

The routine this time is somewhat different. Again we’re starting to supplement a filter to a question as good as exam if a page is for an RSS feed. This time we won’t regulate a query yet (We’ll lapse it usually as it was), though we will supplement a filter to the_content (i.e. a calm of your posts).

function feedFilter($query) {
	if ($query->is_feed) {
		add_filter('the_content', 'feedContentFilter');
		}
	return $query;
}
add_filter('pre_get_posts','feedFilter');
 
function feedContentFilter($content) {
	$thumbId = get_post_thumbnail_id();
 
	if($thumbId) {
		$img = wp_get_attachment_image_src($thumbId);
		$image = '<img align="left" src="'. $img[0] .'" alt="" width="'. $img[1] .'" height="'. $img[2] .'" />';
		echo $image;
	}
 
	return $content;
}

We’re regulating a somewhat devious approach of removing a thumbnail picture so which we can supplement a align="left" part. A lot of feed readers frame out inline CSS, though regulating a out-of-date enter into skill should work. And of course, if we don’t want your images aligned to a left, usually take out a align="left" altogether!

You can have make make make use of of of of which formula to get any distance of thumbnail as well, e.g. let’s contend we had combined this line to your functions.php record to conclude a special thumbnail distance usually for feeds:

add_image_size('feed', 600, 100, true);

Then we could regulate a 7th line from a finish to read:

$img = wp_get_attachment_image_src($thumbId, 'feed');

How to Exclude Posts With a Certain Tag

This time we’re starting to do something identical to a initial example. We’ll be regulating ‘set’ to regulate a question object. If we wish to review some-more about what we can do with querys, check out a WP_Query codex page.

The usually bother is which we have to initial work out a ID of a tag we wish to exclude. To do this, go to Posts > Post Tags, afterwards find a tab we wish to club as good as click on it. In your browser’s residence bar, you’ll see which partial of a URL looks similar to this: &tag_ID=29

So in which case, twenty-nine is a tab ID.

function feedFilter($query) {
	if ($query->is_feed) {
		$tags = array('29');
		$query->set('tag__not_in', $tags);
	}
 
	return $query;
}
add_filter('pre_get_posts','feedFilter');

If we longed for to club posts from mixed tags, we could list them on a 3rd line, e.g.

$tags = array('29', '31', '124');

Control How Many Posts Appear in a Feed

In your dashboard, underneath Settings > Reading, we can set how most posts crop up on your site pages as good as in your feed. However, there competence be times when we wish to uncover more posts in your feed than on your site.

e.g. your site competence demeanour most appropriate with usually 3 or 4 posts per page, though you’d really wish some-more than which in your feed!

To have which change, usually have make make make use of of of of a formula below:

function feedFilter($query) {
	if ($query->is_feed) {
		$query->set('posts_per_page','20');
	}
 
	return $query;
}
add_filter('pre_get_posts','feedFilter');

Feel giveaway to shift a twenty to any number we like!

Show Posts from Only One Category

Normal blogs have been doubtful to do this, though if we were regulating WordPress as a CMS, we competence wish to tell only posts from your “blog” category. In which case, we would do this:

function feedFilter($query) {
	if ($query->is_feed) {
		$query->set('category_name', 'blog');
	}
 
	return $query;
}
add_filter('pre_get_posts','feedFilter');

And again, we could spin which on a conduct to exclude posts from a certain category. In which case, a 3rd line would be:

$query->set('cat', '-45');

Where 45 is a ID of a category (The reduction pointer contingency be enclosed as well, differently you’ll finish up display usually posts from difficulty 45!).

Add Content to a End of Each RSS Post

There have been copiousness of reason we competence wish to add a little content to a finish of your RSS posts. In this initial example, we’ll supplement a elementary line which says:

"Thanks for reading, check out Your Blog name for some-more WordPress news!"

function feedFilter($query) {
	if ($query->is_feed) {
		add_filter('the_content','feedContentFilter');
	}
	return $query;
}
add_filter('pre_get_posts','feedFilter');
 
function feedContentFilter($content) {
	$content .= '<p>Thanks for reading, check out <a href="'. get_bloginfo('url') .'">'. get_bloginfo('name') .'</a> for some-more WordPress news!</p>';
 
	return $content;
}

Now let’s do something somewhat cooler. Let’s contend which we have a featured calm slider on your homepage, or a featured posts list in your sidebar, as good as you’ve set it up so which to supplement posts to possibly of these, you tab them with “featured.”

In this final example, we’ll supplement a byline to your feed posts which says:

"Make certain not to skip a ultimate featured post: Post Title"

In a feedContentFIlter duty this time, we will run a question to get a ultimate post tagged with featured. We’ll afterwards have make make make use of of of of a post intent we get behind to insert a post pretension as good as address.

function feedFilter($query) {
	if ($query->is_feed) {
		add_filter('the_content','feedContentFilter');
	}
	return $query;
}
add_filter('pre_get_posts','feedFilter');
 
function feedContentFilter($content) {
 
	$args = array(
	    'numberposts' => 1,
	    'tag' => 'featured'
	);
	$posts = get_posts($args);
 
	if($posts) {
	    foreach($posts as $post) {
	        $content .= '<p>Make certain not to skip a ultimate featured post: <a href="'. get_permalink($post->ID) .'">'. $post->post_title .'</a>!</p>';
	    }
	}
 
	return $content;
}

You could raise which however we like, e.g. together with a little inline CSS to regulate a coming of a line.

How Else Could You Edit Your Feed?

Those have been a little ideas for what we could do with your feed, though is there anything else you’d similar to to do with it?

Let me know in a comments as good as if there have been any good ideas, I’ll uncover we how to do them!

 How to Edit the WordPress RSS Feed

See a strange post:
How to Edit a WordPress RSS Feed


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO USE THUMBNAILS FOR PREVIOUS/NEXT NAVIGATION IN WORDPRESS

Learn how to enlarge pageviews as well as time-on-site by giving visitors a improved approach to get to your alternative posts regulating thumbnails. Includes a minute educational as well as formula samples for both unchanging themes as well as Thesis.

www.FeedBurner.com) How to Use Thumbnails for Previous/Next Navigation in WordPress How to Use Thumbnails for Previous/Next Navigation in WordPress

See a rest here:
How to Use Thumbnails for Previous/Next Navigation in WordPress


Get Auto Caffeinated Content for Your WordPress Blog



A SIMPLE WAY TO ADD THUMBNAILS TO YOUR POSTS

A certain thing is which people similar to images. They lend towards to demeanour to a picture or a video instead of celebration of a mass something. If we give thema detailed picture afterwards there is a good shift which they will go on with reading.

www.FeedBurner.com) A simple way to add thumbnails to your posts A simple way to add thumbnails to your posts

Go here to see a original:
A elementary approach to supplement thumbnails to your posts


Get Auto Caffeinated Content for Your WordPress Blog



2.5 WAYS TO SHOW CATEGORY IMAGES AS POST THUMBNAILS

This is a extensive reason on 2.5 ways we can do this easily, less-easily, as well as most some-more difficultly as well as advanced. Don’t let a pretension dope you, there’s some-more difficulty thumbnail integrity packaged in this post than we competence initial think.

www.FeedBurner.com) 2.5 Ways To Show Category Images As Post Thumbnails 2.5 Ways To Show Category Images As Post Thumbnails

See a strange post here: 
2.5 Ways To Show Category Images As Post Thumbnails


Get Auto Caffeinated Content for Your WordPress Blog



2.5 WAYS TO SHOW CATEGORY IMAGES AS POST THUMBNAILS

This is a extensive reason on 2.5 ways we can do this easily, less-easily, as well as most some-more difficultly as well as advanced. Don’t let a pretension dope you, there’s some-more difficulty thumbnail integrity packaged in this post than we competence initial think.

www.FeedBurner.com) 2.5 Ways To Show Category Images As Post Thumbnails

Read more: 
2.5 Ways To Show Category Images As Post Thumbnails


Get Auto Caffeinated Content for Your WordPress Blog



KNOW HOW AWESOME YOUR BLOG LOOKS ON IPAD WITH IPAD PEEK

The solitary role of this site is simply to give a ‘peek’ on how will your blog will demeanour in iPad. There have been no announcement banners or even about page which have we adore a site.

However, do keep in thoughts which this site is not functioning just similar to iPad as there is no Flash for iPad. So, to get closer ‘iPad’s experience’, we would indicate we to invalidate Flash in your internet browser.

www.FeedBurner.com) Know How Awesome Your Blog Looks On Ipad with iPad Peek

Go here to review a rest:
Know How Awesome Your Blog Looks On Ipad with iPad Peek


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO HAVE VAULTPRESS LIKE PROTECTION FOR YOUR WORDPRESS BLOG

We can implement couple of plugins which can assistance us grasp identical turn of insurance as well as which as well giveaway of price (almost). We only need to safeguard which you configure a plugins in a right manner.

www.FeedBurner.com) how to have vaultpress like protection for your WordPress blog

See some-more here:
how to have vaultpress similar to insurance for your WordPress blog


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO DISPLAY RECENT, RANDOM AND POPULAR POSTS WITH THUMBNAILS

There have been many WordPress Plugins accessible that allows we to arrangement your Blog’s Recent, Random or Popular Articles in a sidebar, though many of them usually shows Title of a post as well as not a Thumbnails. So, motionless to write a educational to have your sidebar some-more tasteful as well as dashing.

www.FeedBurner.com) How To Display Recent, Random and Popular Posts With Thumbnails

View post:
How To Display Recent, Random as well as Popular Posts With Thumbnails


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO DISPLAY RECENT, RANDOM AND POPULAR POSTS WITH THUMBNAILS

There have been many WordPress Plugins accessible that allows we to arrangement your Blog’s Recent, Random or Popular Articles in a sidebar, though many of them usually shows Title of a post as well as not a Thumbnails. So, motionless to write a educational to have your sidebar some-more tasteful as well as dashing.

www.FeedBurner.com) How To Display Recent, Random and Popular Posts With Thumbnails How To Display Recent, Random and Popular Posts With Thumbnails

Read a original:
How To Display Recent, Random as well as Popular Posts With Thumbnails


Get Auto Caffeinated Content for Your WordPress Blog



GETTING URL OF POST THUMBNAILS IN WORDPRESS 2.9

One of a improvements in WordPress 2.9 is local await for thumbnail images on posts. The API is flattering great – nonetheless it assumes which we wish to lapse a total IMG tag. If we only wish a URL to character as well as formula as we wish – this post shows we how …

www.FeedBurner.com) Getting URL of Post Thumbnails in WordPress 2.9

More: 
Getting URL of Post Thumbnails in WordPress 2.9


Get Auto Caffeinated Content for Your WordPress Blog

Pages