I’m not sure what you mean. What code should I remove? I’m using the Twenty Seventeen theme.
two possiblities:
– to hide the output of post titles on the home page and on posts, using CSS;
example:
.blog .entry-title, .single .entry-header .entry-title { display: none; }
– to fully remove the code;
start by creating a child theme of Twenty Seventeen;
add the following template files from the Twenty Seventeen theme into this child theme (create the same folder structure):
/template-parts/post/content.php
/template-parts/post/content-audio.php
/template-parts/post/content-gallery.php
/template-parts/post/content-image.php
/template-parts/post/content-video.php
in each of the files, remove:
if ( is_single() ) {
the_title( '<h1 class="entry-title">', '</h1>' );
} elseif ( is_front_page() && is_home() ) {
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
} else {
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
}
add
/template-parts/post/content-excerpt.php
to the child theme, and remove this code section:
<?php if ( is_front_page() && ! is_home() ) {
// The excerpt is being displayed within a front page section, so it's a lower hierarchy than h2.
the_title( sprintf( '<h3 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' );
} else {
the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
} ?>