WordPress.org

Forums

Search & Filter
[resolved] Exclude Category from list (22 posts)

  1. downloadabeat
    Member
    Posted 1 year ago #

    Hi is there any way to exclude a category by id from the list? Lets say I just want to filter all audio categories? Is there a way to add it in the shortcode? Thanks! Great plugin by the way!

    http://wordpress.org/plugins/search-filter/

  2. DesignsAndCode
    Member
    Plugin Author

    Posted 1 year ago #

    Hey downloadabeat, thanks for the message. Unfortunately there is no way to include/exclude categories at this stage.

    I will look at including this feature in a future updates as there have been a few requests for this :)

  3. robi333
    Member
    Posted 1 year ago #

    Hi, if it will be possible to exclude/include category and/or tag from the list in the shortcode it will be a great help to me.
    Thank you! Anyway I agree it is a great plugin.

  4. donnytree
    Member
    Posted 1 year ago #

    Just adding in my two cents, awesome plugin! I have the same problem as others though, I need to exclude certain categories from the selection list.

    This is the only plugin that seems to work the best for this since the 3.8.1 upgrade.

    Thanks!

  5. donnytree
    Member
    Posted 1 year ago #

    For those of you still interested and who know PHP, I was able to exclude categories from my dropdown menu by hacking the plugin a bit.

    Go to the search-filter.php file in the plugin folder, and in the generate_wp_dropdown function (line 1396), in the line BEFORE wp_dropdown_categories($args); is called (line 1421), I entered the following code: $args['exclude'] = YOUR_CAT_NUM;, e.g.,

    ...    }
            $args['exclude'] = 2;
    
            $returnvar .= wp_dropdown_categories($args);
    
            return $returnvar;
    }

    If you are not using a dropdown, you probably have to add this into one of the other functions, and on updates you will need to reinsert the code, but at least it's a work around for now.

  6. robi333
    Member
    Posted 1 year ago #

    Hi donnytree,
    It's fine you found a way around. But it is possible to exclude more
    categories than one by means of your $args['exclude'] ?
    Kind regards,
    R

  7. donnytree
    Member
    Posted 1 year ago #

    You should be able to just do:
    $args['exclude'] = 2,3,4,5;

  8. robi333
    Member
    Posted 1 year ago #

    Hi donnytree,
    Thank you very much donny.
    Have a nice day
    Kind regards,
    R

  9. robin1604
    Member
    Posted 1 year ago #

    Hi donnytree,

    If I use comma's then I got an error. Do you have an solution for this problem?

    Thanks,

    Robin

  10. DesignsAndCode
    Member
    Plugin Author

    Posted 1 year ago #

    Hey robin I'mg guessing you use it as a string:

    $args['exclude'] = "2,3,4,5";

    Thanks donnytree for providing your workaround :)

  11. robin1604
    Member
    Posted 1 year ago #

    I used this:
    $args['exclude'] = 2,3,4,5;
    Result was an error

    Now i'm using this:
    $args['exclude'] = "2,3,4,5";
    Result is perfect :D

    Thank you for your help!

  12. lbarron
    Member
    Posted 1 year ago #

    No offense, but this seems like a given to include with the plugin, and there have clearly been several requests, including my need for it. Great plugin once we can get this! And I know I'll use it several times!

    I do appreciate your efforts...so thanks! Plugging away on work-around in the meantime...looking forward to update

  13. DesignsAndCode
    Member
    Plugin Author

    Posted 1 year ago #

    Hey lbarron, it takes a lot of time to do coding for free and manage the support on here - so I try to do the updates when I have time and do what I think is best for the plugin and the users.

    Currently, there are lot of configurable options with the plugin and in the shortcode, so if you would use a shortcode with all the functionality the plugin offers, you would have a very complicated shortcode that is many lines long and to be honest it can be very confusing.

    So the next stage of the project is to develop an admin interface which makes it really easy to build a search form, and will also make it easier to add in new features such as category including/excluding (+ many more).

    But, building a whole admin interface with a really easy to use UI is not an easy task! So please be patient, all free plugin developers are donating a lot of their personal time to their plugins (if they are actively maintained) :)

    Anyway, with the amount of developing hours it takes to add more features it is possible I will launch a pro version and provide better support for things like feature requests!

  14. lbarron
    Member
    Posted 1 year ago #

    Thanks for your response...I know better than to write a message right when I'm in the middle of working on it and also do many things for free, so I should be the first one to appreciate it. I know it takes time and an admin panel does take a lot of effort, so if you do it, will be looking forward to it, as well as a premium version. Headed on the right track and seems like something MANY will benefit from so hopefully your efforts will reap its rewards. Thanks again and I've got it working in the meantime!

  15. DesignsAndCode
    Member
    Plugin Author

    Posted 1 year ago #

    No worries good to hear lbarron :)

  16. mcleek21
    Member
    Posted 11 months ago #

    Hi DesignAndCode,

    Great plugin, any update on this? I am in need of this ability as well but cannot use the hack provided as I am on multisite and don't want to exclude category ID's that overlap on multiple sites so the only way to do it would be in the shortcode or inside the theme template.

    Any update would be appreciated. Again this plugin is really helpful.

  17. DesignsAndCode
    Member
    Plugin Author

    Posted 11 months ago #

    Hey all :)

    The pro version of this actually came out yesterday if you're interested - http://www.designsandcode.com/wordpress-plugins/search-filter-pro/

    I'm also working on an update right now to load the results with AJAX - which will be live tomorrow :)

    @mcleek21 - I had already planned not to add this functionality to the shortcode version (free) however the pro version does have this available.

    You can create as many different search forms as you like and reference specific ones with a shortcode in your theme - so I guess it should do what you want it to? :)

    Thanks

  18. seeiran
    Member
    Posted 11 months ago #

    Hi, if it will be possible to exclude/include category and/or tag from the list in the shortcode it will be a great help to me.
    Thank you! Anyway I agree it is a great plugin.

  19. Boris
    Member
    Posted 10 months ago #

    Hi,
    instead of the 'exclude' function posted here, I would like to include just the categories that I want searched. I simply swapped exclude for include, but then the checkbox function for the next item (post_tags) does not work anymore. Does anyone have an idea how I could get that to work?

  20. hki429
    Member
    Posted 10 months ago #

    I would like to include just the categories that I want searched.

    I have the same request. Could such a thing be added someday? :)

  21. polyfade
    Member
    Posted 9 months ago #

    Does the pro version include the functionality to exclude authors as well as categories?

  22. marcelinosi
    Member
    Posted 8 months ago #

    Just a hint for development: better as exclude would be include - because nevermind how many categories editor add as new, it alway works.. At excluding you have to manage plugin everytime..

    THX

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Search & Filter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic