Info
- 12 posts
- 5 voices
- Started 8 months ago by WebEndev
- Latest reply from mweatherill
- This topic is not resolved
bbPress 2 - Is there a way to search the forums?
-
- Posted 8 months ago #
Is there a way to search the forums/topics via a search tool?
-
- Posted 8 months ago #
At the moment searching the forums is turned off while it is being reworked. It is easy to turn it back on via the theme functions file, but the output results will look odd as mixing forum topics/replies together on a search results page doesn't work to well with default templates.
-
- Posted 8 months ago #
How would you turn it on in functions?
Thanks
-
- Posted 8 months ago #
I would like to know that also..
Just to test it, maybe i google with Google (site) Search stuff.
Are there more features that has been disabled because they are still working on them?
At my forum the Tagged Topics will not get listed by the Tag name when i click on them.
Lest say i add the word bbPress as a Tag to 5 different topics and after that i click on the Tag 'bbPress' is shows ALL topics not only the 5 topics that involve the Tagged (word) 'bbPress'
-
- Posted 8 months ago #
Check out http://gist.github.com/1243500
As mentioned, you are going to have to do some poking around in order for the results to be returned in an orderly fashion :)
-
- Posted 8 months ago #
Hi Jared,
That will definitely help :)
I was actually referring to a Forum *only* search, and not sight wide using the site search. Most forums have this feature.
Thanks
-
- Posted 8 months ago #
Currently with bbPress there is no way easy do that, unfortunately - at least not that I'm aware of! :P
-
- Posted 8 months ago #
If you don't know of a way... it doesn't exist then :)
Thanks!
-
- Posted 8 months ago #
Thank you for the link.
Well it nice to see something turn up, something is always better as: No Results found
-
- Posted 8 months ago #
I am really curious to hear what the best approach to styling the different types of output is.
Does anyone have any good examples of a search results page that returns multiple post-types, yet appears proper?
I usually just use a function to output the post-type in the css class for each item returned and then rely upon the css for custom styling.
*I've also gone the route of using custom templates for each post-type within the search results but that got really tedious very quick.
-
- Posted 8 months ago #
@jaredatch
'// Limit search to topics/replies
add_filter('get_search_form', 'bbpress_search_limit', 10, 3);
function bbpress_search_limit($form, $search_text, $button_text) {
$onfocus = " onfocus=\"if (this.value == '$search_text') {this.value = '';}\"";
$onblur = " onblur=\"if (this.value == '') {this.value = '$search_text';}\"";
$bbpress_form = '
<form method="get" action="' . get_option('home') . '/" >
<input type="text" value="'. $search_text .'" name="s"'. $onfocus . $onblur .' />
<input type="hidden" name="post_type" value="topics" />
<input type="hidden" name="post_type" value="replies" />
<input type="submit" value="'. $button_text .'" />
</form>
';
if (is_post_type_archive( 'forums' , 'topics' , 'replies' ) || is_singular( 'forums' , 'topics' , 'replies' ))
return $bbpress_form;
else
return $form;
}'From the hip... not tested, but I think you get the idea.
*I am just guessing on the conditionals for returning bbpress_form and probably would rework that portion entirely.
-
- Posted 8 months ago #
Just saw a fix for this has been posted here: http://bbpress.trac.wordpress.org/ticket/1575#comment:8
-
You must log in to post.