WordPress.org

Ready to get started?Download WordPress

Forums

Cat + Tag Filter
[resolved] How to exclude tags dropdown from widget? (18 posts)

  1. salihoff.fx
    Member
    Posted 2 years ago #

    Hi Ajayer! Thank for plugin it's realy great!

    I wanted to ask how can I get rid from tags dropdown in my sidebar. I only need option to filter post by category. I'm dummie in coding so if it's possible can you give me string of code that I just can copy and paste to php file.

    Thank again for great plugin

    http://wordpress.org/extend/plugins/cat-tag-filter-widget/

  2. ajayver
    Member
    Plugin Author

    Posted 2 years ago #

    You don't need any plugin for that, just paste this to the place you need:

    <?php wp_dropdown_categories(); ?>

    Here is more info about arguments: http://codex.wordpress.org/Function_Reference/wp_dropdown_categories

    UPDATE: There is even no need to paste any code - just go to your widget options and add the standard "Categories" widget, then choose a drop-down list in its options.

  3. salihoff.fx
    Member
    Posted 2 years ago #

    Thank you for fast reply Ajayer!
    Maybe I did'nt clearly describe what I need. I making blog for review apps and games. I have categories for platform (PC, MAC etc) and I have 2 type of tags - Games Genres and App Types. I want to make easy sorting for user. For example, user can choose game tag - adventure and choose platform PC. I realized that I can make it using your widget for category filter and 2 super tag widgets for showing 2 different types of tags (Games, Apps).

    Now I realized I can do this without super tag widgets just by placing 2 of your Cat + Tag widgets. But in tag dropdown both widgets showing similar tags. I've read other post where you placed a string of code that can exclude uneeded tags. But if I edit code in php file it will affect to both of widgets am I right?

    Maybe I'm just in wrong way and there more easy method to realize what I'm need?

  4. ingbas
    Member
    Posted 2 years ago #

    Hi Ajayer,

    I need the same option.
    I want to place your widget on different pages, but with different search options.

    For example: on one page I want to show the 2 categories cats and dogs with their tags, on an other page I want to show two other categories with their tags.
    I know I can do this: $tags = get_tags('exclude=2,45,101');
    But when I do that both search widgets exclude them.

    B.t.w. How do I exclude categories? Like this:
    $categories = get_categories('pad_counts=1''exclude=34');

    If this is not possible, can you make a clone of your widget so I can upload the clone and than exclude different things.

    The nice thing is, that your widget works great with the plugin Search everything.

  5. ajayver
    Member
    Plugin Author

    Posted 2 years ago #

    I've just uploaded an update of the plugin (version 0.4), where you can choose tags and categories to exclude. Now you can choose different tags and categories for each widget instance. I hope it will help.

  6. ingbas
    Member
    Posted 2 years ago #

    Hello Ajayver,

    Thanks for the update. Now it is a perfect widget-plugin!

    5 STARS!

  7. tranhien1945
    Member
    Posted 2 years ago #

    How I remove Tag?
    I want to keep categories and taxonomy in my sidebar. However get_the_list_catagory show all, include Tags,
    Please, help me: http://www.nhadatdacdia.com
    Thanks

  8. tranhien1945
    Member
    Posted 2 years ago #

    I just config, But I want to more taxonomy, Now your plugin support only one tag. Please help me
    thanks

  9. ajayver
    Member
    Plugin Author

    Posted 2 years ago #

    I'm not sure what you mean.
    Do you use categories and tags to filter? Or category + custom taxonomy? Please show the screenshot of widget settings.

  10. Kees-V
    Member
    Posted 1 year ago #

    Hello Ajayver,
    You uploaded an update of the plugin (version 0.4), where you can choose tags and categories to exclude.
    I have a few hundred tags on my site, but I would like to use only 6 for the filter.
    Is there also an easy option to include only those 6 tags.
    Thanks.

  11. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    Hello!
    Find line 89 in cat-tag-filter.php:
    if ($ctf_options['exclude_tags'] != '') $args = 'exclude=' . $ctf_options['exclude_tags'];
    And replace it with this line:
    if ($ctf_options['exclude_tags'] != '') $args = 'include=' . $ctf_options['exclude_tags'];

    Then enter only tag id's that you want to show in exclude field in options.

  12. Kees-V
    Member
    Posted 1 year ago #

    Thanks a lot!

  13. Sam-30
    Member
    Posted 1 year ago #

    Thanks - great plugin and support

  14. OlderFart
    Member
    Posted 1 year ago #

    The original poster stated:
    "I wanted to ask how can I get rid from tags dropdown in my sidebar."

    That's exactly what I need to do (remove the Tags drop-down menu). There's an option to "Hide Categories Dropdown", but no option to "Hide Tags Dropdown".

    I have about 100 categories that are divived into groups of related sub-categories. I want to display multiple instances of your widget on a page and filter out specific groups of categories from each one; i.e. have one list of sub-categories in one, another list in another, and so on.

    I also want to show only ONE dropdown list of tags on the page and exclude (hide" the tags dropdowns from all but one of the instances. In other words, I need a "Hide Tags Dropdown".

    Is there a simple way to do this?

    GREAT pluggin, by the way. Nearly perfect.

  15. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    I didn't understand what do you want to filter. How do you want the widget to look like? Why can't you use <?php wp_dropdown_categories(); ?> ?

  16. OlderFart
    Member
    Posted 1 year ago #

    The 'Standard' WP categories dropdown widget doesn't provide any filtering options at the admin user interface level, which makes it necessary to write code and modify files. Your widget doesn't require any code development or page/widget modifications to impliment (great plugin, by the way) and is a big time saver.

    All I need is the option to 'Hide Tags Dropdown' in each instance of the widget, so I can display multiple instances of your category dropdown, which you have developed to provide a simple, graceful and efficient method of filtering out undesired categories by ID number.

    Where you have created a very nice admin level user interface, the standard WP categories widget user interface provides nothing, in terms of filtering categories. I am trying to avoid writing code and modifying files.

  17. ajayver
    Member
    Plugin Author

    Posted 1 year ago #

    You can install the wp php widget plugin, add it to your sidebar and then put this code into it:

    <?php $args = array(
    	'show_option_all'    => '',
    	'show_option_none'   => '',
    	'orderby'            => 'ID',
    	'order'              => 'ASC',
    	'show_count'         => 0,
    	'hide_empty'         => 1,
    	'child_of'           => 0,
    	'exclude'            => '',
    	'echo'               => 1,
    	'selected'           => 0,
    	'hierarchical'       => 0,
    	'name'               => 'cat',
    	'id'                 => '',
    	'class'              => 'postform',
    	'depth'              => 0,
    	'tab_index'          => 0,
    	'taxonomy'           => 'category',
    	'hide_if_empty'      => false
    );
    wp_dropdown_categories( $args ); ?>

    Change the options you want and you will get a proper category dropdown

  18. OlderFart
    Member
    Posted 1 year ago #

    I did as you suggested; installed the 'wp php widget plugin', actived it, copied and pasted the above code into each of the five widget code windows, gave them all unique names, input all the category IDs for all the categories I didn't want to display in each one (via the 'exclude' arguments array element), and each one displays a list of unique categories.

    It looks nice and they allow me to select a unique group of related parameters/categories, but when I make those selections, nothing happens. There is no relationship between any of the five category dropdown lists and there is no mechanism to perform a search based on those selections. There's a 'missing link' to tie them all together and perform a search.

    So, what was the purpose of this excercise, other than the obvious (that I need to look elsewhere)?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic