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



DISPLAY EXTERNAL RSS FEEDS

There have been so most process to arrangement External Feeds, On this tips, have use of a little WordPress functions as well as have it uniformly on in WordPress, You can tweak this formula as well to have it some-more improved by adding additional calm such as mention as well as most more

www.FeedBurner.com) Display External RSS Feeds

Originally posted here: 
Display External RSS Feeds


Get Auto Caffeinated Content for Your WordPress Blog



BUILD A WORDPRESS 2.8 WIDGET WITH THE NEW WIDGET API

One of a categorical changes in WordPress 2.8 is a brand new widget API . This API is entirely intent oriented as well as provides a programmer all a required functions to emanate a WordPress widgets

2384e97131rss-widget-backend-133x150 Build A WordPress 2.8 Widget With The New Widget API

Here is a strange post: 
Build A WordPress 2.8 Widget With The New Widget API


Get Auto Caffeinated Content for Your WordPress Blog



KEVIN ASKED: “HOW TO: DISABLE SEARCH ENGINE INDEXING ON A PARTICULAR CATEGORY?”

To achieve, initial get a ID of a difficulty you’d similar to to be not indexed by poke engines. In this exemple, we pretence your difficulty id is 8. Open your header.php record as well as pulp a following formula in between a <head> as well as </head> tags: <?php if ( is_category(’8′) || in_category(’8′) ) { relate ‘<meta name=”robots” content=”noindex”> ‘; } That’s all

See a strange post: 
Kevin asked: “how to: invalidate poke engine indexing on a sold category?”


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO: ADD NEW GRAVATARS TO WORDPRESS DEFAULT GRAVATAR LIST

Simply pulp this formula on your functions.php file. Don’t dont think about to shift paths to a images in a code. if ( !function_exists(’fb_addgravatar’) ) { duty fb_addgravatar( $avatar_defaults ) { $myavatar = get_bloginfo(’template_directory’).’/images/avatar.gif’; //default avatar $avatar_defaults[$myavatar] = ‘people’; $myavatar2 = get_bloginfo(’template_directory’).’/images/myavatar.png’; //Avatar for user “admin” $avatar_defaults[$myavatar2] = ‘admin’; lapse $avatar_defaults; } add_filter( ‘avatar_defaults’, ‘fb_addgravatar’ ); } Thanks to WpEngineer for this good hack! Wanna have income blogging

Continued here:
How to: Add brand brand new Gravatars to WordPress default gravatar list


Get Auto Caffeinated Content for Your WordPress Blog



FEEDBURNER MOVING FEEDS OVER TO GOOGLE.COM

A integrate of months ago we switched my Feedburner comment over to Google in sequence to try out their AdSense for feeds module (not on a WP Hacks feed, though usually on a integrate of sites we run that modify great with AdSense).  At a time, you do so was particularly voluntary.  According to a integrate of reports I’ve been celebration of a mass around a blogosphere a past integrate days, it looks similar to everybody who hasn’t already changed their feeds to Google will be stirred to do so in a really nearby future. Is this a great thing?  we suspect there have been a little advantages to carrying your feeds on your Google account.   So distant a usually complaint I’ve run in to given creation a switch to Google’s Feedburner is a Feedcount WordPress plugin we was using, that no longer functions with a brand brand new setup.  we went in as well as hacked a plugin formula a bit to try to get it work, though it still wasn’t operative with a brand brand new setup. Anyone else carrying any problems given switching your Feedburner comment to Google?

More:
Feedburner Moving Feeds Over to Google.com


Get Auto Caffeinated Content for Your WordPress Blog



MAKE THE MOVE FROM FEEDBURNER TO GOOGLE

If you’re a blogger, we substantially make use of FeedBurner to guard your feed stats. It’s a good giveaway use which gives we a lot of sum about who’s subscribed to your feed as well as a little collection to foster it. Google paid for over FeedBurner in a Summer of 2007, as well as have been right away relocating all of a FeedBurner accounts in to their Google accounts

ba611bca52windowslivewriterhowtomovefromfeedburnertogoogle-c353fb-main1-1bf6578f-a7e2-4a1b-b68a-d7a150f3974f-150x38 Make the Move from FeedBurner to Google

Here is a original:
Make a Move from FeedBurner to Google


Get Auto Caffeinated Content for Your WordPress Blog

Get Auto Caffeinated Content for Your WordPress Blog



WORDPRESS TV: VIDEOS FOR WP BLOGGERS, WORDCAMP FOLLOWERS

Takes a demeanour at WordPress.TV as well as reflects on WP expansion for 2008

Excerpt from: 
WordPress TV: Videos For WP Bloggers, WordCamp Followers


Get Auto Caffeinated Content for Your WordPress Blog



10 THINGS TO DO AFTER INSTALLING WORDPRESS

The WordPress 5-minute implement is great, zero difficult about removing your blog up as well as using (most of a time). But once we implement WordPress there have been a series of alternative stairs which we need to take in sequence to get a many from your blog. Use a following as a to-do checklist for your destiny installations as well as you’ll keep yourself right.

8c81f8fba2windowslivewriter10thingstodoafterinstallingwordpress-103b8installingwp1-e0c4b627-e55a-45f1-b275-4e61260d7371-150x38 10 Things to do After Installing WordPress

Read more: 
10 Things to do After Installing WordPress


Get Auto Caffeinated Content for Your WordPress Blog

Pages