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

#1855

StartupWP
Support

Actually, that will disable the ability to reach the single post from archive, tag, cat and search pages, instead, use:

<?php if ( is_singular() ) {echo '<h1 class="entry-title">';} else {echo '<h2 class="entry-title">';} ?><?php if ( !is_singular() ) {echo '<a href="' . get_permalink() . '" title="<?php printf( __('Read %s', 'startup'), the_title_attribute('echo=0') ); ?>" rel="bookmark">';}<?php the_title(); ?><?php if ( !is_singular() ) {echo '</a>';}<?php if ( is_singular() ) {echo '</h1>';} else {echo '</h2>';} ?>

Thank you.