Articles of add feed

how to publish a feed of posts with a certain custom field value?

In addition to the normal feed that wordpress produces, i need to publish an additional feed of posts that have a certain custom field value. I’m a bit lost on where to start. Any tip?

Custom JSON feed rewrite

I’m trying to implement a feed of information from an Event custom post type in JSON format, to be used in a FullCalendar implementation, pretty much as described here. The one thing I wanted to change was to create an actual WordPress feed to generate the JSON output, to avoid the hack of looking for […]

Creating a custom feed for categories that includes the first post's featured image

I’m needing a little help getting this figured out. I have a query that’s not quite working right now, but I need it to create a custom feed that includes category information and then includes the featured image from the first post in that category. Anyone have thoughts on how to get that running? /** […]

How to get feed for pages?

I have a question about WordPress feeds. I know that the default feed: http://www.example.com/feed/ is for the post post type. However, I would like to create a new feed, only for the page post type, e.g. http://www.example.com/kellyspagefeed/ I don’t want to override the default one. Can anyone give me a direction on how to get […]

Custom RSS feed forces download

I’m trying to implement a custom RSS feed that is formatted for podcasting and pulls in the audio file from an Advanced Custom Field. Basically I’ve been working off of the example provided here: https://css-tricks.com/roll-simple-wordpress-podcast-plugin/ My plugin looks like this: // add a custom RSS feed function podcast_rss(){ add_feed(‘podcast’, ‘run_podcast_rss’); } add_action(‘init’, ‘podcast_rss’); function run_podcast_rss(){ […]

add_feed and flush_rewrite_rules

There seems to be quite a controversial opinion on the WordPress flush_rewrite_rules() function. According to the Codex, it is highly discouraged to use this function on the init action hook. However: In a plugin I am working on, I am using add_feed() to, well, add a feed. The Codex says that this should be run […]

Cannot get add_feed to work

I want to add a custom feed on my site for SEO purposes. So, I first copy the /wp-includes/feed-rss2.php file into my theme folder and renamed it. I figured I’ll be able to easily edit my feed. Then I add this code : function yandex_news_feed() { load_template(TEMPLATEPATH . ‘/yandex-news.php’); } function yandexnews_add_feed() { add_feed(‘do_feed_yandexnews’, ‘yandex_news_feed’); […]

Change of query var in pre_get_posts not maintained

I’m creating a plugin that adds a custom feed. I am using a pre_get_posts filter to change the posts_per_page query var to -1 (to get all items of a custom post type). However, if I dump the $wp_query in the render function, posts_per_page remains the default. I tested also changing posts_per_rss to -1, and I […]

Yoast custom feed template as add_feed function?

I’m trying to make Yoast’s Custom RSS feeds post display in an add_feed function. Just putting Yoast’s snippet inside add_feed results in: ERROR: feedname is not a valid feed template. I have tried two rewrite functions, but to no avail. What could I be missing? Yoast’s function untouched: <?php /* Template Name: Custom Feed */ […]

Possible to use conditionals within add_feed() callback?

I’m using add_feed() to create some custom feeds but calls to is_singular(), is_home() etc… just don’t seem to work within the callback. Is there a workaround for this? Example code: add_action( ‘init’, ‘my_init’ ); function my_init() { add_feed( ‘new_feed’, ‘feed_output’ ); } function feed_output() { if ( is_home() ) load_template( ‘/path/to/feed/home/template.php’ ); else load_template( ‘/path/to/feed/template.php’ […]