Community Forums › Forums › Archived Forums › Design Tips and Tricks › Would like to ONLY show titles for search results page
Tagged: search results
- This topic has 3 replies, 3 voices, and was last updated 11 years, 5 months ago by
ccstone.
-
AuthorPosts
-
February 7, 2014 at 3:34 pm #89214
Stefsull
MemberI've googled and searched through this forum. Usually, my Google foo is strong, but I must not be using the right terminology—because I can't imagine no one else in the world wants to do what I'd like to. Here's my issue:
The site I've used Genesis for is a support site. As such, the designer wants only the article/post titles/headers to show up on the results page. (It seems the default is to show the entire post for every search result.) I've tried 3 or 4 things (in my child theme's function file) the final attempt was to duplicate the search.php page into my child theme and modify it like Jen Baumann explained in this forum post: http://www.studiopress.community/topic/how-do-i-create-a-custom-search-results-page/
I'm still not getting any truncation of the posts like the article above (I haven't yet tried for headers only). It just seems I can't get anything to change in my search results at all. This is my site: http://support.contatta.com
Am I approaching this in the wrong way? Do the search/archive results use something not called posts? I'm baffled.
http://support.contatta.comFebruary 11, 2014 at 4:10 pm #89875Stefsull
MemberSince I never got an answer here, I'll add the answer for someone else that might want to do the same thing. The REAL issue is that the answer I was basing my attempts on was using the XHTML hooks and I needed the HTML5 hooks. So upgrading the example in the linked support post—for HTML5, I used:
add_filter('pre_get_posts','SearchFilter');
// Formatting search output
/** Remove the post info function */
remove_action( 'genesis_entry_header', 'genesis_post_info' );
/** Remove the post meta function */
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
/** Removes everything form post content **/
remove_all_actions( 'genesis_entry_content' );
/** Add your custom content **/
add_action( 'genesis_entry_content', 'custom_post_content' );
function custom_post_content() {
the_content_limit( '90',(' ') );
}
genesis();My designer decided he was okay with a short line of the article following the title. Cheers.
February 15, 2014 at 11:58 am #90503madhattie
MemberThank you for the follow-up post for the solution. This will be helpful for me as well.
The result on your site looks great!
February 17, 2015 at 1:45 pm #141132ccstone
ParticipantI tried using the HTML5 version as stated above, but I'm just getting the codes at the top of the search result page and the rest of the page is blank.
I'm using Lifestyle Pro theme and I only want the Titles in search results.
Can anyone help?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.