New Topic

Reply To: When viewing a single post page, make the title not a link but just text

Home › Forum › Customization › When viewing a single post page, make the title not a link but just text › Reply To: When viewing a single post page, make the title not a link but just text

#1861

StartupWP
Support

Apologies, give this a try:

<?php if ( is_singular() ) { echo '<h1 class="entry-title">'; } else { echo '<h2 class="entry-title">'; } ?><?php if ( !is_singular() ) { echo '<a href="' . get_permalink() . '">'; } ?><?php the_title(); ?><?php if ( !is_singular() ) { echo '</a>'; } ?><?php if ( is_singular() ) { echo '</h1>'; } else { echo '</h2>'; } ?>