1

I have been busy with RSS feeds lately so I can auto load my content in my email service.

I have build a feed (which works) and inside the feed I can toggle preferences by filtering on categories, meta fields and sorting.

However, the thing is I want to have multiple feeds. E.g. 1 for each category, meta field and sorting. This would imply that I would have to make a lot of feeds.

So what I was wondering is, isn't is possible to have one feed and use queries (or something) in the url?

At present the feed is accessible on: http://testend.nl/demo1/feed/nieuw. This feed shows all content sorted by date (descending).

The code I use for this is below. I need the $posts later on to load the RSS items.

<?php

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$posts = query_posts(array(
'post_type' => 'course',
'orderby' => 'rand',
'post_per_page' => '-1',
'order' => 'DESC', 
'paged' => $paged,  
'tax_query' => array(
        array( 
        'taxonomy' => 'course-cat',
        'field' => 'slug', 
        'terms' => 'web-ontwikkeling' 
    )
  ),

'meta_query'=> array(
    array(
      'key' => 'featured',
      'compare' => '=',
      'value' => 1,
      'type' => 'numeric',
    )
  )

));


header('Content-Type: '.feed_content_type('rss-http').'; charset='.get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';

?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.