Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 1 reply, 2 voices, and was last updated 10 years, 2 months ago by
Steven Zahm.
-
AuthorPosts
-
06/06/2016 at 9:23 am #378555
Matthew Custer
ParticipantWhile on a category and performing a search…
http://www.custerinc.com/our-team/?cn-s=&cn-cat=13
I would like the search results to show all contacts removing the category filter.
06/06/2016 at 10:47 am #378556Steven Zahm
Keymaster@ Matthew
This can be done, but requires a little code snippet to add this functionality. Here’s how:
Install the Code Snippets plugin.
Add a new snippet with the following code:
add_action( 'wp', 'cn_search_category_reset' ); function cn_search_category_reset() { global $wp_rewrite, $post; $keywords = get_query_var( 'cn-s' ); $categoryIDs = get_query_var( 'cn-cat' ); $categorySlug = get_query_var( 'cn-cat-slug' ); if ( ! empty( $keywords ) && ( ! empty( $categoryIDs ) || ! empty( $categorySlug ) ) ) { cnSEO::doFilterPermalink( FALSE ); // Get the directory home page ID. $homeID = cnSettingsAPI::get( 'connections', 'connections_home_page', 'page_id' ); $permalink = $wp_rewrite->using_permalinks() ? trailingslashit( get_permalink( $homeID ) ) : get_permalink( $homeID ); wp_redirect( add_query_arg( array( 'cn-s' => $keywords, 'cn-cat' => FALSE, 'cn-cat-slug' => FALSE ), $permalink ) ); exit; } elseif ( ! empty( $categoryIDs ) && ! empty( $categorySlug ) ) { cnSEO::doFilterPermalink( FALSE ); // Get the directory home page ID. $homeID = cnSettingsAPI::get( 'connections', 'connections_home_page', 'page_id' ); $permalink = $wp_rewrite->using_permalinks() ? trailingslashit( get_permalink( $homeID ) ) : get_permalink( $homeID ); wp_redirect( add_query_arg( array( 'cn-cat' => $categoryIDs, 'cn-cat-slug' => FALSE ), $permalink ) ); exit; } }Save and activate the snippet.
Now when a user does a search, the category selection will be reset.
Hope that helps! Let me know.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
