WordPress.org

Ready to get started?Download WordPress

Forums

Faceted Search
[resolved] Exclude Categories? (10 posts)

  1. mark7694
    Member
    Posted 3 years ago #

    I love this plug-in. It would make my day if there was a way to exclude specific tags or categories from the widget though. Can that be done my tweaking the code in the actual widget if it is not already a feature?
    Thanks.

    http://wordpress.org/extend/plugins/faceted-search/

  2. AndrewUlrich
    Member
    Plugin Author

    Posted 3 years ago #

    you might be able to tack on something like query .= 'AND p.ID <> ANY (SELECT * FROM '.$wpdb->prefix.'term_relationships WHERE term_taxonomy_id = '.$excluded_id; right after line 340 in faceted-search.php. You would then just get the $excluded id from $_POST. That would be a starting point for you.

  3. 1000Li
    Member
    Posted 2 years ago #

    Oh, please could you explain this to a person who doesn't know php?
    How to exclude multiple categories (say ID=16 and ID=18)? Huge thanks in advance!

  4. AndrewUlrich
    Member
    Plugin Author

    Posted 2 years ago #

    Version 3.2 has this functionality now.

  5. James
    Member
    Posted 2 years ago #

    can you set it up so that this function actually works?

  6. AndrewUlrich
    Member
    Plugin Author

    Posted 2 years ago #

    Is something not working for you, or do you mean you want more specific instructions?

  7. James
    Member
    Posted 2 years ago #

    lol turns out more specific instructions would have done the trick. I was trying to put a list of cat id's when I should of been putting the cat name.... who knew?

  8. AndrewUlrich
    Member
    Plugin Author

    Posted 2 years ago #

    Oh, I see. Glad it's working for you after all! I'll try to remember to clarify that in the FAQ for the next release.

  9. aleyho
    Member
    Posted 2 years ago #

    I found a problem in faceted-search.php, line 501 and 503 needed to replace "name" with "term_id". now it works well.

  10. AndrewUlrich
    Member
    Plugin Author

    Posted 2 years ago #

    Hi aleyho, I think you're doing the same thing James Callaway was doing, which is putting the term id's into the list rather than the term names. That's fine if you modify the code in the way you specified, but the intended purpose was to put in the term names.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic