WordPress.org

Support

Support » Plugins and Hacks » [Plugin: WP Realtime Sitemap] Exclude Category from "Post & Custom Post Type Settings"

[Plugin: WP Realtime Sitemap] Exclude Category from "Post & Custom Post Type Settings"

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rincewind

    @rincewind

    This is currently not possible with the plugin as it is at the moment, but is something I can look into when I have some free time.

    I 2nd this request. right now not having this option is making me look elsewhere for a similar plugin that does.

    Plugin Author Rincewind

    @rincewind

    thats fine feel free to do just that, feel free to donate if you want this feature so bad.

    Thank you Rincewind for a great plugin.

    I managed to exclude a category from the posts list by editing the wp-realtime-sitemap/wp-realtime-sitemap.php file and hardcoding the excluded category. A quick fix until something better becomes available.

    At line 1632 of the file wp-realtime-sitemap/wp-realtime-sitemap.php, you will find the following:


    } else {
    // Set options for post query
    $theposts = get_posts(array(
    'numberposts' => $post_numberposts,
    'orderby' => $post_orderby,
    'order' => $post_order,
    'exclude' => $post_exclude,
    'post_type' => 'post',
    ));

    I simply added one more line to the get_posts call, so it becomes:


    } else {
    // Set options for post query
    $theposts = get_posts(array(
    'numberposts' => $post_numberposts,
    'orderby' => $post_orderby,
    'order' => $post_order,
    'exclude' => $post_exclude,
    'post_type' => 'post',
    'category' => '-15',
    ));

    where 15 is the category ID of the category to be excluded. You can exclude multiple categories by listing their negative IDs separated by commas.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: WP Realtime Sitemap] Exclude Category from "Post & Custom Post Type Settings"’ is closed to new replies.