[wp-hackers] Search in multiple categories

Tareq Hasan tareq1988 at gmail.com
Mon Jan 17 07:45:38 UTC 2011


Thanks Tom for answering. But you are *MISSING* my point, I know how to
search in a single category, but I have to search in multiple categories and
may be in *FOUR* categories.

Suppose I need to search for "SMTP", and I have categories like "Drupal",
"Wordpress", "Joomla", "Expression Engine" and etc. So I want to search in
"Drupal", "Wordpress" and "Joomla" categories. How to do that?

--------------------------------------------
Best regards
Tareq Hasan
Blog <http://tareq.wedevs.com> | Twitter
<http://twitter.com/tareq_cse> | বিএলইউএ
- লিনাক্স টিউটোরিয়াল, টিপস-ট্রিকস, রিভিউ <http://linux.org.bd/>





On Mon, Jan 17, 2011 at 4:15 AM, Tom Jenkins <tom at thejenkinsweb.com> wrote:

> You just need to have your category dropdown within the search form itself.
>
> <form method="get" id="searchform" action="<?php bloginfo('url');?>/" >
> <label for="s">Search</label>
>
> <input type="text" value="<?php echo
> attribute_escape(apply_filters('the_search_query', get_search_query())) ?>"
> name="s" id="s" />
>
> <label for="">Topic</label>
>
> <?php
>
> wp_dropdown_categories('depth=0&orderby=name&hide_empty=1&show_option_all=Search
> Everything'); ?>
>
> <input type="submit" id="searchsubmit" value="Search" />
>
> </form>
>
>
> Tom
>
> ==============================
> Tom Jenkins
> Development Director for Adcuda <http://adcuda.com>
> Web: http://techguytom.com
> twitter: http://twitter.com/techguytom
>
>
>
> On Sun, Jan 16, 2011 at 7:23 AM, Tareq Hasan <tareq1988 at gmail.com> wrote:
>
> > Hello all,
> > I need some help in a search functionality. Suppose I have a widget with
> > search box and there is four category dropdown. I want to search for the
> > query only in selected 4 categories. So what will be the procedure? and
> how
> > to give the names of category fields?
> >
> > I tried with the two query form (showing with 2 cat):
> > (1) ?s=wifi&sa=search&cat[]=61&cat[]=62
> > (2) ?s=wifi&sa=search&cat=61,62
> > Both didn't work what I wanted.
> >
> > Please help me.
> > --------------------------------------------
> > Best regards
> > Tareq Hasan
> > Blog <http://tareq.wedevs.com> | Twitter
> > <http://twitter.com/tareq_cse> | বিএলইউএ
> > - লিনাক্স টিউটোরিয়াল, টিপস-ট্রিকস, রিভিউ <http://linux.org.bd/>
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list