I am using WordPress and the Genesis framework for a site. I’m using a child theme (Ayoshop – not that it matters much) for the theme. I would like to customize the search results page by removing the ‘post info’ area where it shows the date, author, and ‘leave a comment’ link, and instead show the featured image for that post. The theme is using the search.php
page from the Genesis theme, so I’m not really sure how to proceed in how to customize it.
Here is the code from the Genesis theme search.php
:
add_action( 'genesis_before_loop', 'genesis_do_search_title' );
/**
* Echo the title with the search term.
*
* @since 1.9.0
*/
function genesis_do_search_title() {
$title = sprintf( '<div class="archive-description"><h1 class="archive-title">%s %s</h1></div>', apply_filters( 'genesis_search_title_text', __( 'Search Results for:', 'genesis' ) ), get_search_query() );
echo apply_filters( 'genesis_search_title_output', $title ) . "n";
}
genesis();
It actually did matter that it was the Ayoshop theme, there was a custom filter that was added in a file called
theme-tweaks.php
that removed the original post info and added a custom post info, so I needed to remove that custom action.All of the changes were done in the
functions.php
file.I made sure to remove the genesis_post_info, and then removed the custom action that Ayoshop added.
I then added an action to add the image to the post.