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



CREATING A WORDPRESS THEME (PART 6): FOOTER

This is a final partial of a series. We’ve already seen a pattern creation, an key about a WordPress height as well as a coding as well as styling of a complete thesis solely a footer. So, in this final post, we’re starting to do a footer and, to finish a blog, let’s additionally see a little plugins. The footer is flattering elementary as well as we’re starting to supplement a little one more styles which we’ve been regulating during a series.

www.FeedBurner.com) Creating a WordPress Theme (Part 6): Footer

Here is a strange post:
Creating a WordPress Theme (Part 6): Footer


Get Auto Caffeinated Content for Your WordPress Blog



INCREASING THE CATEGORIES SELECTION HEIGHT IN WORDPRESS ADMIN

Increasing a tallness of a categories preference inventory in WordPress admin regulating 2 opposite methods, CSS as well as jQuery. The initial process creates a bound tallness as well as a second creates a energetic height.

FeedBurner Increasing The Categories Selection Height In WordPress Admin

Continued here: 
Increasing The Categories Selection Height In WordPress Admin


Get Auto Caffeinated Content for Your WordPress Blog



ALL THE USEFUL PLUGINS FOR WORDPRESS COMMENTS

The WordPress criticism area contingency be managed, orderly as well as stylized with CSS as well as WP hacks or a easy way, regulating plugins. There have been here 47 WordPress plugins as well as we goal they will assistance you.

www.FeedBurner.com) All The Useful Plugins For WordPress Comments

See some-more here: 
All The Useful Plugins For WordPress Comments


Get Auto Caffeinated Content for Your WordPress Blog



CREATING A ROUND CORNER CSS WEBSITE LAYOUT

How to set up a turn dilemma CSS website with energetic peep calm with Dreamweaver CS5

See a rest here:
Creating a turn dilemma css website layout


Get Auto Caffeinated Content for Your WordPress Blog



CREATING A ROUND CORNER CSS WEBSITE LAYOUT

How to set up a turn dilemma CSS website with energetic peep calm with Dreamweaver CS5

Go here to review a rest:
Creating a turn dilemma css website layout


Get Auto Caffeinated Content for Your WordPress Blog



ALL THE USEFUL PLUGINS FOR WORDPRESS COMMENTS

The WordPress criticism area contingency be managed, orderly as well as stylized with CSS as well as WP hacks or a easy way, regulating plugins. There have been here 47 WordPress plugins as well as we goal they will assistance you.

Go here to see a original:
All The Useful Plugins For WordPress Comments


Get Auto Caffeinated Content for Your WordPress Blog



THE FINE LINE BETWEEN INSPIRATION AND REPLICATION

Art as well as conceptualizing is all about removing desirous by a component of star as well as beautifully putting them in graphical representation. To be desirous by an additional designer’s art work is really healthy as well as positive

Here is a original:
The Fine Line in in between Inspiration as well as Replication


Get Auto Caffeinated Content for Your WordPress Blog



5 OF THE BEST WORDPRESS BLANK THEMES

Writing a same formula again as well as again is as well bad. Not usually we have been losing time though additionally it’s boring.

View strange here: 
5 of a most appropriate WordPress Blank Themes


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO INTEGRATE AN OPTIONS PAGE INTO YOUR WORDPRESS THEME

Creating themes to give divided or sell is great, though not everybody who uses your thesis will have a plain bargain of HTML/CSS.

Go here to see a original:
How to Integrate an Options Page in to your WordPress Theme


Get Auto Caffeinated Content for Your WordPress Blog

Pages