30th
You can just place the following code into your functions.php file within your theme folder.
function set_canonical() {
if ( is_single() ) {
global $wp_query;
echo '<link rel="canonical" href="'.get_permalink($wp_query->post->ID).'"/>';
}
}
add_action('wp_head', 'set_canonical');
That’s it! Now if you go to any version of your post page, you will see the little link on the top of the page publicly telling bots that the preferred version of the page is the permalink version. Take that duplicate contents!
First, you have to add the following code to your function.php file. Don’t forget to change the adsense code, unless you’d like to display my ads on your own site ![]()
function showads() {
return '<script type="text/javascript"><!--
google_ad_client = "pub-3637220125174754";
google_ad_slot = "4668915978";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
';
}
add_shortcode('adsense', 'showads');
Once you saved the functions.php file, you’re now able to embed your adsense code on your posts and display it exactly where you want. To do so, simply paste the following code on the editor, in html mode:
[adsense]
about:config
layout.spellcheckDefault
0
Disable spellchecker.
1
Enable spellchecker for multi-line controls (e.g., <textarea>s).
2
Enable spellchecker for multi-line controls and single-line controls.