WordPress.org

Ready to get started?Download WordPress

Ideas

Add to the function "get_posts" the exclusion of some categories

  1. bigalex
    Member

    12345

    I don't know why, but actually the function can only show one, more than one or all categories. It could be useful to add the exclusions of one or more categories, because when it is not possible to use query_posts (out of the loop) it's really useful to have this function.

    Regards,
    Alessio Periloso

    PS: Actually I've hacked wp-includes/post.php to exlude one given category, I'm looking for help to exclude more categories.

    Posted: 6 years ago #
  2. Chris_K
    Member

    12345

    Ultimate Category Excluder plugin?

    Posted: 6 years ago #
  3. bigalex
    Member

    12345

    Why make a plugin when it's more logical to add it in the includes, where are other similar functions?
    I don't know, but I think it's a good idea to implement it in the includes...

    Posted: 6 years ago #
  4. Edward Caissie
    Theme Review Admin

    get_posts() now has exclude parameter, see codex page: http://codex.wordpress.org/Function_Reference/get_posts

    Also see ../wp-includes/post.php (line 571 WP version 2.9.2) for further reference.

    Posted: 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    4 Votes
  • Status

    This idea has been implemented