How I Added Permalink To Post And Page Title In Genesis Framework

I recently have become a targets of scrapers with majority of my blog post getting copied to the scrapers site usually filled with Ads. to deter them, i first change my blog feed from full display to summary. i wasn’t quite satisfied so i decided to add posts or pages permalink or URL to its titles.
If your WordPress theme is base on the Genesis framework, add the below code to your theme function.php so as to add a link to your titles.

[javascript]
add_filter( ‘genesis_post_title_output’, ‘ac_post_title_output’, 15 );
function ac_post_title_output( $title ) {
if ( is_singular() )
$title = sprintf( ‘<a href=”%s” title=”%s” rel=”bookmark”>%s</a>’, get_permalink(), the_title_attribute( ‘echo=0’ ), apply_filters( ‘genesis_post_title_text’, $title ) );
return $title;
}
[/javascript]

If you are using other WordPress theme, simply open your single.php file and locate where the title is displayed. Then, replace the code by the following:
[javascript]
<h1>
<a href=”<?php the_permalink(); ?>”>< ?php the_title(); ?></a>
</h1>
[/javascript]

Don’t miss out!
Subscribe to My Newsletter
Invalid email address