registerla.blogg.se

Wordpress custom rss feed
Wordpress custom rss feed





wordpress custom rss feed wordpress custom rss feed

But we must first generate the list of posts that we want to exclude. We’re going to use the “post_not_in” parameter that can be used to exclude a list of posts. This time it’s not so easy because we have no query parameter that can be used to exclude posts based on custom fields. I named the field “no_syndication” and I always give it the value “1”. So I decided to use a custom field to mark the posts to exclude from my new feed. I went further because I did not want to use a tag to exclude some posts: that tag would have been public even if it was only meaningful to me. A feed excluding articles with a custom field (meta-data) The documentation of query_posts details the various parameters that you can use. Now you can further customize the feed by adding supplementary query parameters to the $args array. That was relatively easy, thanks to the “tag_not_in” query parameter. Query_posts ( $args ) include ( 'wp-includes/feed-rss2.php' ) ?>Īrray('tag_not_in' => array($tag->term_id)) query, array ( 'tag_not_in' => array ( $tag -> term_id ) ) ) The initial content of that file should be this: You should now create a “feed-myfeed.php” file and put it in your current theme’s directory.Go to “Settings > Feed Wrangler” in your WordPress administrative interface and create a new feed, let’s call it “myfeed”.First of, install the Feed Wrangler plugin, it will take care of registering our custom feeds with wordpress.The best solution found involves creating a custom feed. You can also have feeds excluding a category, although that requires you to know the category identifier (and hardcode it in the URL like this: /?feed=rss2&cat=-123 where 123 is the category id that you want to exclude).īut there’s no simple way to have a feed that excludes articles with a given tag. You can create feeds for “unions” or “intersections” of tags, you just have to use a URL like /tag/foo,bar/feed/ (all articles tagged with foo or bar) or /tag/foo+bar/feed/ (all articles tagged with foo and bar). But in some cases, you want feeds built with some more advanced logic.

wordpress custom rss feed

WordPress has many alternate built-in feeds: per category, per tag, per author, per search-keyword.







Wordpress custom rss feed