in Wordpress Themes by bob197 (120 points)

Post titles are linked when showing on the posts page and they remain linked after being clicked and opening to a single post view.

I would like to remove the hyperlink from the title in the single post view.  

I intended to replace

<a href=”<?php the_permalink() ?>”><?php the_title(); ?></a>

with

<?php the_title(); ?>

However, I do not see the code I was expecting to edit in the single.php file.

What is the best way to remove the hyperlink from post titles in single post view?

1 Answer

by lisa-west (31.7k points)
Hi,

You can remove the hyperlink from the the title in the single post manually .Go to Wordpress folder -> wp-content -> themes -> content.php -> Find line no 45 -> Remove this code ->  if(get_post_meta($postid,'ttr_post_link_enable_checkbox',true)!= 'false'):?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'TemplateToaster' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php endif; ?><?php the_title(); ?></a>

-> Add this given code ->

if(is_single($postid) )
{
     the_title();
}
elseif(is_blog) {
        if(get_post_meta($postid,'ttr_post_link_enable_checkbox',true)!= 'false'):?>
        <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'TemplateToaster' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php endif; ?><?php the_title(); ?></a>
<?php
}

?>
Interested in localizing/Translating TemplateToaster Software in your native language in exchange of a Pro License ? Contact Us
...