Joey
(@leglesslizard)
Hey,
In the child theme you would want to copy the relevant template and make your changes there. For example, on wordpress’ twentysixteen theme search.php pulls in content from template-parts/content-search.php to determine what aspect of the posts to display on the search results page ( using this code: get_template_part( 'template-parts/content', 'search' ); ).
So you need to investigate your parent theme for something similar. If the theme is well built the templates should be well named and the folder structure solid making this an easy task but sometimes you have to inspect the code in your browser to see exactly what is output and run a search through the theme to find what you are looking for.
I hope that helps.
Regards
Hi Joey,
Thanks for the quick reply. I did copy the search.php and searchpage.php to the child theme. I found this code in the search.php as you mentioned:
<?php
/*
Template to filter categories
*/
get_header(); ?>
<!–Blog section–>
<section class=”blog”>
<div class=”container”>
<div class=”row”>
<div class=”col-md-8 post-left”>
<div class=”page-heading-minor”>
<h3><?php printf( __( ‘Search Results for: <span class=”color”>%s</span>’, ‘theme name’ ), get_search_query() ); ?></h3>
</div>
<?php get_template_part( ‘content’, ‘search’ ); ?>
<?php get_template_part( ‘pagination’ ); ?>
</div>
<?php get_sidebar(); ?>
</div>
</div>
</section>
<?php get_footer(); ?>
What exactly I need to edit in this file to remove the Posted By in the search results?
Thanks!
Joey
(@leglesslizard)
When you’re pasting code; please use backticks or the code button above 🙂 makes it much easier to read.
That pulls in code from content-search.php
get_template_part( 'content', 'search' );
So I should think that file will have the code you need to modify.