Cat + Tag Filter
Search text in specified categories/tags (5 posts)

  1. socorrista22198
    Posted 3 years ago #

    Hi ajayver, how could we implement to this wonderful plugin the hability to search text inside selected categories or tags?

    For example, the user writes the words to search, and also selects in what category and tag the program would search those words.

    Is like merge the default wordpress search function with this plugin, Is it posible?

    Best regards


  2. ajayver
    Plugin Author

    Posted 3 years ago #

    You can try putting this lines

    if (is_category()){ ?>
        <input type="hidden" name="category_name" value="<?php echo get_query_var('category_name'); ?>"/>
    if (is_tag()){ ?>
        <input type="hidden" name="tag" value="<?php echo get_query_var('tag'); ?>" />
    <?php } ?>

    inside your search form.

  3. socorrista22198
    Posted 3 years ago #

    That code is only for search at the same category/tag always dont? the user of the page couldn´t be able to select the category and tag where to search the text.

    Cat-tag-filter-widget is able to select a category and tag using dropdowns, but can´t search the text typed in a textfield.

    Is posible to add a text field to this widget? So the user would be able to type a text, and the search of that text would be only inside the posts/pages belonging the category and tag selected at the dropdowns.

  4. ajayver
    Plugin Author

    Posted 3 years ago #

    It is possible, but it will be easier to write this code from scratch. All you need to do is to generate a url like site.com/?category_name=[category]&tag=[tag]&s=[search query]

  5. socorrista22198
    Posted 3 years ago #

    Okay I don´t know a lot about programation, I hope someone do what you said "to write code from scratch" for generate the url.

    Anyway, thanks a lot for you time and wonderful plugin.
    Best regards.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Cat + Tag Filter
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic