Archived topic
Single Blog Post Title as a Link
3 replies · Started by Toby on April 13, 2018
I'd like the blog post title (single) to be a link (to that blog URL).
Is it possible to edit somewhere?
Hi there,
Not sure if I understand, you are wanting the single post title to link to the main blog page?
Let me know.
Hi Leo,
I want the single post H1 to link to that particular post.
Linking to the page you're currently on isn't typically recommended, but it's possible with a child theme.
You'd need to copy the current content-single.php file from the parent theme into your child theme.
Then replace this:
if ( generate_show_title() ) {
the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' );
}
With this:
if ( generate_show_title() ) {
the_title( sprintf( '<h1 class="entry-title" itemprop="headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' );
}