• danieltrezub

    (@danieltrezub)


    Hi, guys.

    My feed is empty after the update to 2.9.2.

    I use a small plugin to filter my feed to include just one category.

    the code is the following:

    <?php
    /*
    Plugin Name: Feed Filter
    Plugin URI:
    Description: Filters your feed to include only certain categories.
    Version: 0.1
    Author: Daniel Trezub
    Author URI: http://www.gameblogs.com.br
    
    */
    add_filter('pre_get_posts','filterRSSQuery');
    function filterRSSQuery($query) {
    	if ($query->is_feed) {
            $query->set('cat','49');
        }
    return $query;
    }
    ?>

    If I disable this little plugin, the feed works ok, but with all categories, of course.

    If I enable it, the feeds does not validate and shows empty (saying something like “Error parsing XML: no element found”.

    In the feedvalidator.org website it returns me “line 1, column 0: XML parsing error: <unknown>:1:0: no element found”

    Note that before the update to 2.9.2. everything was working great. No changes were made to ANY file on the installation.

    I’ve already tried to use $query->set('category_name','GameBlogs'); with the same results.

    Any ideas, please?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP 2.9.2 – feed error – blank feed with filter’ is closed to new replies.