WordPress.org

Forums

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

  1. socorrista22198
    Member
    Posted 2 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

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

  2. ajayver
    Member
    Plugin Author

    Posted 2 years ago #

    You can try putting this lines

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

    inside your search form.

  3. socorrista22198
    Member
    Posted 2 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
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 2 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

About this Topic