Blocking adsense ad units for a particular country [closed]

A quick google search gave me this. This plugin seems to have this feature: http://wordpress.org/extend/plugins/ad-injection/faq/ How can I show different ads to people in different countries? If you install the Country Filter plugin (with the IP database) then you can use the following code in the direct ad insertion modes. This will not work in … Read more

How to add Adsense code to child theme

You can easily put your Google Adsense code within the <head> element of your WordPress site by using either of these methods in your functions.php file or by creating a plugin for that purpose: /** * Load my Google Adsense code. * * Here, your Google Adsense Code is stored within in your plugins directory, … Read more

Block Adsense on specific page

You can use this function: <?php if(is_page(‘your-page-slug’)): ?> //do nothing on selected pages <?php else: ?> <script async src=”https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js” /> <script> </script> <?php endif; ?> If you want to disable this on more than one page, just add them like this: <?php if(is_page(‘your-page-slug1’) || is_page(‘your-page-slug2’)): ?> WordPress Developer Resources are very useful (more than codex), … Read more

Inserting AdSense code right after tag

Without using a plugin, the WordPress way would be to use the wp_head action to insert the script and then enqueue the script file: function mytextdomain_adsense() { $output=” <script> </script>”; echo $output; } add_action(‘wp_head’,’mytextdomain_adsense’); function mytextdomain_adense_script() { wp_enqueue_script( ‘my-adsense’, ‘//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js’, array(), ‘1.0.0’, false ); } add_action( ‘wp_enqueue_scripts’, ‘mytextdomain_adense_script’ ); And to add the async attribute … Read more

Adding Google Custom Search to a Public Released Theme

You can improve it, combining Google Search and WordPress Search. using this simple javascript: function displaygoogle(checkbox){ if(checkbox.checked){ document.getElementById(“googlesearchbox”).style.display = ‘block’; document.getElementById(“wordpresssearchbox”).style.display = ‘none’; document.getElementById(“googlesearchinput”).value = document.getElementById(“wordpresssearchinput”).value; } else{ document.getElementById(“googlesearchbox”).style.display = ‘none’; document.getElementById(“wordpresssearchbox”).style.display = ‘block’; document.getElementById(“wordpresssearchinput”).value = document.getElementById(“googlesearchinput”).value; } } see more detail here: http://jaider.net/2011-05-08/how-to-combine-google-wordpress-search/

How can I add Google ads to my home page?

How do you have your home page set up and what template are you trying to modify? Usually it is index.php or home.php, but it can also be front-page.php or even something completely different from defaults. See Template Hierarchy in Codex.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)