WordPress.org

Forums

WP Realtime Sitemap
Exclude Category from "Post & Custom Post Type Settings" (5 posts)

  1. mitico13
    Member
    Posted 3 years ago #

    Is possible to exclude category id and not only singular post? And is possible to make a list of post from only one category?
    Thanks

    http://wordpress.org/extend/plugins/wp-realtime-sitemap/

  2. Rincewind
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  3. onesummer
    Member
    Posted 3 years ago #

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

  4. Rincewind
    Member
    Plugin Author

    Posted 3 years ago #

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

  5. akhayyat
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Realtime Sitemap
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic