WordPress.org

Ready to get started?Download WordPress

Forums

Cat + Tag Filter
[resolved] Exclude Taxonomy (13 posts)

  1. daniella_mayumi@hotmail.com
    Member
    Posted 3 years ago #

    First of all, this plugin is awesome!
    I was wondering if there's a way to exclude a tag from appearing on the selection box.
    Thanks.

  2. ajayver
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks!
    You can open the cat-tag-filter.php file and find line
    $tags = get_tags();
    And change it to
    $tags = get_tags('exclude=2,45,101');
    where 2,45,101 are tag IDs that you want to exclude.

  3. daniella_mayumi@hotmail.com
    Member
    Posted 3 years ago #

    Thank you so much!

  4. squizeers
    Member
    Posted 3 years ago #

    Is it possible to have sub categories instead of tags of the categories selected? Or if there is any plugin that does it.

  5. ajayver
    Member
    Plugin Author

    Posted 3 years ago #

    Try this code <?php wp_dropdown_categories("child_of=$cat"); ?>

  6. squizeers
    Member
    Posted 3 years ago #

    Thanks for the quick response. Will try it and let you know.

  7. flavioluizmelo
    Member
    Posted 3 years ago #

    Hi, Ajayver!!! Greetings from Brazil. Tell me buddy if its possible extend the query for more than one tag, example:

    Cat 1 Laptops
    + tag Dell
    + tag 15,1 inch screen

    Best regards, Flavio

  8. ajayver
    Member
    Plugin Author

    Posted 3 years ago #

    That is easy and was planned, but I can't find a way, how to include this feature without ruining usability. Any Ideas on how to design it?

  9. juelu
    Member
    Posted 2 years ago #

    Hi ajayver

    Many congratulations to your plugin! We're planning to use it on our site. As we'd really need to be able to choose more than just one tag, I'd be really grateful if you could send me the code.

    Additionally, I have an idea on how to design it. It would be perfect if you could choose which tags you show on dropdown 1 and which tags you show on dropdown 2.

    So to take the example of flavioluizmelo:
    Cat 1 Laptops
    + tag Dell, Lenovo, Apple
    + tag 15'', 17'', 20''

    It's a bit of configuration for the user, but I think this would be very helpful.

    Best regards

    juelu

  10. kavlexster
    Member
    Posted 2 years ago #

    Greating ajayver from Greece

    Thank you for a plugin.

    I have one question it is possible to have other one slide down box for tags to get more better filter ?

    Like this -))
    Category + Tags (include=1,2,3,4) + one more tags (include=5,6,7,8)

    B/ Regards

  11. kokosmin
    Member
    Posted 2 years ago #

    Here is a design idea, i would like your plugin too.
    This site in an online store but I see no reason we could not do this in wordpress.
    http://www.youtube.com/watch?v=1-u26ureCf8

  12. ajayver
    Member
    Plugin Author

    Posted 2 years ago #

    It is currently almost same - dropdown for categories and checkboxes or dropdown for tags.
    We can't do exactly same with wordpress without changing the query. My plugin doesn't touch the query it only generates the proper link - standard wordpress does the rest.

  13. squizeers
    Member
    Posted 2 years ago #

    FOR CATEGORY AND SUB CATEGORY FILTER I DID FOLLOWING

    <?php
    wp_dropdown_categories('selected=-1
    &hierarchical=1
    &depth=1
    &hide_empty=0
    &exclude=1,4,6,11,12,149,150,151
    &show_option_none=Select Category
    &name=main_cat');
    ?>
    
    <select  name="sub_cat" id="sub_cat" disabled="disabled">
    </select>
    
    <script type="text/javascript">
        var dropdown = document.getElementById("sub_cat");
        function onCatChange() {
    		if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
    			location.href = "<?php echo get_option('home');
    ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
    		}
        }
        dropdown.onchange = onCatChange;
    </script>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic