Search Results for 'code'
-
Search Results
-
i want to only display user role on keymaster and moderators users.
I dont want every participant to have the role shown , only the keymaster and moderators are important enough to me to show their role next to their avatar.
How would i do that??
im just using this code to display the users role
<div class=reply-author-role><?php bbp_reply_author_link( array( 'show_role' => true, 'type' => 'role' ) ); ?></div>My site is running mainly CPTs but I filter my search results to a subset of these using this technique:
function filter_search($query) { if ($query->is_search) { $query->set('post_type', array('A','B', 'C')); }; return $query; }; add_filter('pre_get_posts', 'filter_search');which works fine for wordpress but when I search within BBP i get the ‘Oh bother! No search results were found here!’ message as you’d expect because of the above filter.
If i remove the filter the BBP search works fine, and if I add ‘forum’, ‘topic’, ‘reply’ to the above filter BBP search works fine, but the problem is get I the forum results appearing in the main search results page.
Also, If i remove the filter all together I still get forum results appearing in the main results page.
Is there a way to exclude forums results from appearing in the main search?