Make Post Titles Non Clickable Inside The Posts

As you might have noticed that the Title Links of the posts on my blog are not clickable when you open any post. This is done so that we don’t violate the TOS of google adsense, if you planning to place ads under the Title Text. This tutorial will teach you how to achieve it in minimal steps. I assume that you know the basics of editing the theme and templates.

Make Post Titles Non Clickable Inside The Posts

For WordPress Users:

01. In your WordPress Admin Dashboard, in left hand side, click on Appearance -> Editor

editor

02. Now Click on Single.php from your right hand sidebar Theme Files.

single.php

03. Search for:

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

And Replace It with:

<h2><?php the_title(); ?></h2>

All done. Now when you open any post, the Post Title Text will not be clickable.

Note: The Headings i.e. <H2> as here, can be different with different themes, but most themes use H2 as Post Title Heading. Just find and replace accordingly.

For Blogger Users:

01. Go to Layout -> Edit HTML and click on Expand Widget Templates

edit html

02. Now look for something similar to this code in your template:

<b:if cond=’data:post.title’>

<h2 class=’post-title entry-title’>

<b:if cond=’data:post.link’>

<a expr:href=’data:post.link’><data:post.title/></a>

<b:else/>

<b:if cond=’data:post.url’>

<a expr:href=’data:post.url’><data:post.title/></a>

<b:else/>

<data:post.title/>

</b:if>

</b:if>

</h2>

</b:if>

And Replace It with:

<b:if cond=’data:blog.pageType != "item"’>

<h2 class=’post-title entry-title’>

<a expr:href=’data:post.url’><data:post.title/></a>

</h2>

<b:else/>

<h2 class=’post-title entry-title’>

<data:post.title/>

</h2>

</b:if>

All done. Now when you open any post, the Post Title Text will not be clickable.

Note: The Headings i.e. <H2> as here, can be different with different templates, but most templates use H2 as Post Title Heading. Just find and replace accordingly.

Hope this helps.

One Comment

  1. k.roshan October 8, 2011

Leave a Reply

Your email address will not be published. Required fields are marked *