Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Which theme are you using?
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
As this is part of the theme, you’ll need to create a Child Theme and modify the HTML elements in which the search results template uses, to use <h2>
in stead of <h1>
.
I’ve never used that before; can you tell me how I would change it so that it only affects the search results and not all of the pages?
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
You’ll need to duplicate the search results template into your Child Theme. Then edit this duplicate file.
Here is the template information; can you tell me what exactly I need to edit to make the title of each search result display in an h2 tag?
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyeleven' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Here is the template information;
Is this the file header.php ?
this is the search.php page.