• I’m trying to show search results only for a specific custom post type, my code is simple and I already tested it successfully on some wordpress sites I made, but in this case (buddypress) looks like it is not working.

    Here is my form:

    <form id="vendor-search" action="<?php bloginfo('siteurl'); ?>" method="get">
    <h5>Search for vendors</h5>
    <input type="hidden" name="post_type" value="vendors" />
    <label for="s" class="screen-reader-text">Search for:</label>
    <input type="text" id="s" size="23" name="s" value="" />
    <input type="submit" value="Search" id="searchsubmit" />

    So I set this hidden input:

    <input type="hidden" name="post_type" value="vendors" />

    and then I get a correct URL when searching, something like:
    mywebsite.com/?post_type=vendors&s=Marketing
    but on displayed results it is including all kind of posts and pages…

    Any ideas about what can this be?

    Thanks a lot!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Buddypress] Search for custom post type only is not working’ is closed to new replies.