In this tutorial, I will show you how to add Google Adsense code to the WordPress site using the right method. Yes, the right method means, just add single Google Adsense JavaScript and place the ads on the places you want. Also, the right method means to add Google Adsense JavaScript to the Footer, not in the Header. This way it will eliminate the JavaScript render-blocking warning. I am sure, that if you will use this method to add Adsense code to the WordPress site, it will not impact your website performance. Because if you put the Adsense code in the Head tag (<head></head>), it will definitely impact your WordPress site performance, which you can test using the website speed test tools such as Google PageSpeed and GTmetrix, etc.

Now I already brief you about it, that what are the advantages of adding Google Adsense Main JavaScript code to the Footer in WordPress site. So let's start the tutorial.

Steps to Add Google Adsense Code to WordPress Using the Right Method

1. Get Google Adsense Main JavaScript Code 

First, get the Google Adsense Main JavaScript code from the Adsense. To do this, open your Google Adsense Account page and click on the Ads and then from the right side pane click on the Get Code link to get the Single Google Adsense JavaScript code, as shown in the below image:

Get Google Adsense Main JavaScript code.

2. Install Plugin in WordPress to Insert Adsense Code to the Footer

You have copied the Adsense JavaScript code, now you have to install a plugin, through which you can add the code in the footer. To do this, open the WordPress click on the Plugins > Add New and search for the Header and Footer Scripts. You will find the Header and Footer scripts plugin as shown in the below image. Now click on the install button and then Activate it.

Install header and footer scripts plugin in WordPress.

3. Open the Header and Footer Script Page

After activating the plugin, click on the Settings > Header and Footer Scripts as shown in the below image:

Go to header and footer scripts setting page.

4. Add Google Adsense Code to WordPress

Now paste the Google Adsense JavaScript code in the Footer scripts area as shown in the below image:


Note: your Adsense JavaScript code may be different as shown in the above image because of Google code updates.

5. Enable Adsense Auto Ads

To enable Auto Ads, you need to click on the Pencil icon right side of your website name to enable Auto Ads. This is the page from where you copied the Adsense JavaScript code. Below is the image:


After enabling the Adsense auto ads, it is itself sufficient to show Ads on your site automatically in the appropriate places and this is the also right method. But mostly, we want the Google Adsense to show the ads on the places selected by us. To do this, follow these steps:

6. Create an Ad and get the JavaScript code

To create an Adsense Ad, click on the Overview page > By Ad Unit and then select the Ad type as shown in the below image:

Create Adsense Ad unit.

7. Save and Get the Ad Unit Code

After completing the Ad creation, save and get the code. As shown in the below image:

Save and Get Adsense Ad unit code.

[right-side] After copying the Adsense code, you no need to paste the full code because you have already added the main JavaScript (<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>). And if you will add full code then it will unnecessarily increase the JS code in your WordPress site, which will have a bad impact on your site. To take a specific part of this code, paste this code into a text editor and copy the only part as shown in the below example:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-xxxxxxxxxxxx"
     data-ad-slot="11xxxxxxxx"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

8. Place the Adsense Code in Website's Widget Area

To place the above Adsense code in the WordPress site, click on the Appearance > Customize > Widgets > select the widget area and then add an HTML type widget and paste the above code in it.

Then click on the Publish button to save the changes and to make it live on the site. Google takes 4 to 5 minutes depends on your website traffic to display the ad.

To place the ads above posts or between posts follow this step:

9. Add Adsense code in the Post in WordPress

To insert ads between the WordPress posts, you need to install a plugin Post Adverts. To do this, click on the Plugins > Add New and search for the Post Adverts. Then install and activate the plugin.


Now click on the Post Adverts > Add New Post and paste the Adsense Ad code as shown in the 7th step. Here you can specify the display position of the ad to above post or below the post and after a specific paragraph, as shown in the below image:



This way you can add the Adsense code anywhere in your WordPress website.

So in this tutorial, you have learned the right method to add Adsense code to the WordPress site.

Related tutorial:

Computer not working.

Learn how to resolve computer issue, when the power light is on, but there is no apparent system activity.

Check the Power-Supply Voltages. Use a Voltmeter to Verify that Each Output from the Power Supply is Correct. Below the Table-1 Lists the Proper Voltage for Each Wire Color.

If any Output is very Low or Absent (Especially the 5-V Output ), Replace the Power Supply. Use a Voltmeter and Verify that the Power Good (or PwrOK) Signal is the +5 V. If this Signal is Below 1.0 V, It Might Inhibit the CPU from Running by Forcing a Continuous Reset Condition. Because the Good Power Signal is Generated by the Power Supply, Try Replacing the Power Supply.

Check to See that the CPU is Cool, that the Heatsink/Fan Assembly is Fitted on Correctly, and that the CPU Itself is Inserted Properly and Completely into its Socket.

Check the CPU Socket-If the CPU is Seated in a Zero Insertion Force (ZIF) Socket, Be Sure that the Socket's Tension Lever is Closed and Locked into Place.

If there is a Separate Math Coprocessor on the Motherboard (i286 and i386 Systems), Be Sure that the MCP is Inserted Properly and Completely into its Socket.

Next, Check the Expansion Boards and Be Sure that all Expansion Boards are Seated Properly. Any Boards that are not Secured Properly, or that are Inserted Unevenly Can Short Bus Signals and Prevent the PC from Starting.

Check the Motherboard for Shorts. Inspect the Motherboard at Every Metal Standoff and See that no Metal Traces are being Shorted Against a Standoff or Screw.

You Might want to Free the Motherboard and See if the System Starts. If it does, use Non-Conductive Spacers (Such as a Small Piece of Manila folder) to Insulate the Motherboard from Each Metal Standoff.

If the System Still Fails to Start (And all Voltages from the Power Supply are Correct), Replace the Motherboard.

Hope that helps.

Table-1: PINOUTS of ATX and Baby AT Power Connector

ATX Power Connector


COLOR VOLTAGE PIN
Orange +3.3 Vdc 1
Orange +3.3 Vdc 2
Black GND 3
Red +5 Vdc 4
Black GND 5
Red +5 Vdc 6
Black GND 7
Gray PwrOK 8
Purple +5V standby 9
Yellow +12 Vdc 10
Orange(22AWG) +3.3 Vdc 11
Brown (22AWG) 3.3 V sense 11
Blue -12 Vdc 12
Black GND 13
Green PS-ON 14
Black GND 15
Black GND 16
Black GND 17
White -5 Vdc 18
Red +5 Vdc 19
Red +5 Vdc 20

Baby AT Power Connectors


COLOR VOLTAGE PIN
Orange PwrOK 1 (P8)
Red +5 Vdc 2 (P8)
Yellow +12 dc 3 (P8)
Blue -12 Vdc 4 (P8)
Black GND 5 (P8)
Black GND 6 (P8)
Black GND 1 (P9)
Black GND 2 (P9)
White -5 Vdc 3 (P9)
Red +5 Vdc 4 (P9)
Red +5 Vdc 5 (P9)
Red 6 (P9)

Computer not running.

Learn how to resolve a computer issue, when there is no power light, but cooling fan is running.

Usually means that some level of ac power is reaching the system. Use a voltmeter and Confirm that there is Adequate ac Voltage at the wall outlet. Unusually low ac Voltages (Such as During "Brownout" Conditions) can cause the Power supply to Malfunction.

Verify that the Power-Supply Cables are Attached properly and securely to the Motherboard. Use a Voltmeter to Verify that Each output from the Power supply is Correct.

Table-1 illustrates the Proper Voltage for Each Wire/Color. If any Output is very Low or Absent (Especially the +5 Volt Output), Replace the Power Supply. Finally, Use a Voltmeter and Verify that the Power Good (or PwrOK) Signal is +5 V.

If this Signal is Below 1.0 V, it Might Inhibit the CPU from Running by Forcing a Reset Condition. Because the Power Good Signal is Generated by the Power Supply, Try Replacing the Power Supply.

Table-1: PINOUTS of ATX and Baby AT Power Connector

ATX Power Connector


COLOR VOLTAGE PIN
Orange +3.3 Vdc 1
Orange +3.3 Vdc 2
Black GND 3
Red +5 Vdc 4
Black GND 5
Red +5 Vdc 6
Black GND 7
Gray PwrOK 8
Purple +5V standby 9
Yellow +12 Vdc 10
Orange(22AWG) +3.3 Vdc 11
Brown (22AWG) 3.3 V sense 11
Blue -12 Vdc 12
Black GND 13
Green PS-ON 14
Black GND 15
Black GND 16
Black GND 17
White -5 Vdc 18
Red +5 Vdc 19
Red +5 Vdc 20

Baby AT Power Connectors


COLOR VOLTAGE PIN
Orange PwrOK 1 (P8)
Red +5 Vdc 2 (P8)
Yellow +12 dc 3 (P8)
Blue -12 Vdc 4 (P8)
Black GND 5 (P8)
Black GND 6 (P8)
Black GND 1 (P9)
Black GND 2 (P9)
White -5 Vdc 3 (P9)
Red +5 Vdc 4 (P9)
Red +5 Vdc 5 (P9)
Red 6 (P9)

Computer not starting.

Learn how to resolve the issue when there is no power light, and you cannot hear any cooling fan noise in the computer.

Chances are that there is Insufficient Power to the Computer. Use a Voltmeter and Confirm that there is Adequate ac Voltage at the Wall Outlet. Check the ac Cord next-it Might be Loose or Disconnected. See that the Power Switch is Turned on and Connected Properly. Check the Power-Supply Fuse(S). The Main Fuse Might have Opened. Replace any Failed Fuse.

If You Replace the Main Fuse and the Fuse Continues to Fail, You Might have a Serious Fault in the Power supply. Try Replacing the Power Supply.

Java Program

This tutorial is to show you how to declare variables in Java.

In Java, all variables must be declared before they can be used in the programs. The following is the syntax of variable declaration in Java.

Java - Variable Declaration Syntax

type identifier [ = value ][, identifier [ = value ] ...];

Here the type is the Java supported data types, or the class name, or interface name. The identifier is the name of the variable. To initialize a variable in Java, use equal sign and a value. To declare more than one variable of the same type, use a comma to separate.

Example - Declaring Variables in Java

In the following Java program, it is declaring multiple variables, and some of them include an initialization.

public class Variables {
    public static void main(String args[])
    {
        int x, y, z; // declares three intejers of x, y, and z.
        int a = 4, b, c = 9; // declares intejer a with value 4 and c with value 9 but b not yet initialized

        byte d = 21;
        double pi = 89.14252;
        
        char ch = 'x';
        
        String s = "abc";

        // printing the variables value that have been initialized
        System.out.println("a = " + a);
        System.out.println("c = " + c);
        
        System.out.println("d = " + d);
        System.out.println("pi = " + pi);
        
        System.out.println("ch = " + ch);
        System.out.println("s = " + s);        
        
        // variables x, y, z, and b not yet initialized
        
    }
}

Output

a = 4
c = 9
d = 21
pi = 89.14252
ch = x
s = abc

जानिये पेट और कमर की चर्बी कम करने के उपाय

शरीर पर मोटापे के बढ़ने के मुख्य संकेत

शरीर पर मोटापे के बढ़ने के मुख्य संकेत ठोड़ी नीचे व गले के ऊपर मांस बढ़ना और पेट कमर व कूल्हों की चर्बी बढ़ना होता है। मोटापा कम करने के लिए पेट व कमर को सही अनुपातिक आकार में करना पेहला कदम है। आज यहाँ आपके लिए, पेट और कमर की चर्बी कम कैसे करें इस विषय में कुछ कारगर उपाय प्रस्तुत करते है।

गलत ठंग से आहार विहार याने खान पान व रहन सहन से जब शरीर पर चर्बी बढ़ती है तो पेट बाहर निकल आता है, कमर मोती हो जाती है और कूल्हे भरी हो जाते हैं। इसी अनुपात से हाथ पैर और गर्दन पर भी मोटापा आने लगता है। जबड़ो के नीचे गर्दन मोटी होना और तोंद बढ़ना मोटापे के मोटे लक्षण है।

पेट और कमर की चर्बी कम करने के उपाय

मोटापे से जहां शरीर भद्दा दिखाई देता है वहीं स्वास्थय से सम्बंधित कुछ व्याधियां पैदा हो जाती हैं लिहाज़ा मोटापा किसी भी सूरत में अच्छा नहीं होता। बहुत कम स्त्रियां मोटापे के शिकार होने से बच पति हैं। हर समय कुछ न कुछ खाने की शौकीन, मिठाइयां, तेल पदार्थ का अधिक सेवन करने वाली और शारीरिक परिश्रम न करने वाली स्त्रियों के शरीर पर मोटापा आ जाता है।

प्रायः प्रसूति के बाद असावधानी, गलत आहार विहार से स्त्रियों का पेट बढ़ जाया करता है। गर्भ काल में जो स्त्रियाँ नाखून से पेट खुजाया करते हैं उनके पेट पर सफेद धारियां पड़ जाती हैं। जिन्हें किक्किस कहते हैं। प्रसव के बाद ४० दिन तक पेट बांध कर रखने से पेट बड़ा नहीं हो पता। पेट बांधने की बेल्ट बाजार में मिलती है। पहली कोशिश तो ये करनी चाहिए की पेट बढ़ने ही न पाये क्योंकि एक बार पेट बढ़ जाने पर कम करना कठिन और समय-साध्य कार्य हो जाता है। इसके लिए दो तीन बातों का ध्यान रखना जरुरी है।

प्रायः महिलाएं भोजन करके खूब पानी पिया करती हैं। इस विषय में निरोग धाम के गत अंकों में विस्तार से यह बताया जा चूका है की भोजन के अंत में पानी पीना उचित नहीं बल्कि १-१ घंटे बाद ही पानी पीना चाहिए। इससे पेट और कमर पर मोटापा नहीं चढ़ता बल्कि मोटापा हो भी तो कम हो जाता है

आहार भूख से थोड़ा कम ही भोजन खाना चाहिए।  इससे पाचन भी ठीक होता है और पेट बड़ा नहीं होता। पेट में गेस नहीं बने इसका ख्याल रखना चाहिए। गेस के तनाव से तन कर पेट बड़ा होने लगता है। दोनों समय शौच के लिए अवश्य जाना चाहिए। भोजन में शाक सब्जी, कच्चा सलाद और कच्ची हरी शाक सब्जी की मात्रा अधिक और चपाती, चावल व आलू की मात्रा कम रखना चाहिए। सप्ताह में एक दिन उपवास या एक बार भोजन न करने के नियम का पालन करना चाहिए। उपवास के दिन सिर्फ फल और दूध का ही सेवन करना चाहिए

बफारे की भाप - पेट की चर्बी कम करने के लिए

पेट व कमर की चर्बी कम करने के लिए सुबह उठने के बाद या रात को सोने से पहले नाभि के ऊपर उदर भाग को बफारे की भाप से सेक करना चाहिए। इसकी विधि -- एक तपेली पानी में एक मुठ्ठी अजवायन और एक चम्मच नमक दाल कर उबलने रख दें। जब भाप उठने लगे तब इस पर जाली या आटा छानने की छन्नी रख दें। दो छोटे नेपकिन या कपड़े ठन्डे पानी में गीले कर निचोड़ ले और थे करके एक-एक कर जाली पर रख गरम करें और पेट पर रख कर सकें। प्रति दिन १० मिनट सेक करना पर्याप्त है। कुछ दिनों में पे की चर्बी कम होने लगेगी।

मोटापा घटाने के आसन

सुबह उठ कर शौच से निवृत होने के बाद निम्नलिखित आसनों का अभ्यास करें या प्रातः २-३ किलोमीटर तक घूमने जाया करें।

पौष्टिक आहार

भोजन के गेंहू के आटे की चपाती लेना बंद करके जों और चने के आटे की चपाती लेना शुरू कर दें। इसका अनुपात है १० किलो चना और दो किलो जों। इन्हें मिलाकर पिसवा ले और इसी आटे की चपाती खाएं। इससे सिर्फ पेट और कमर का ही नहीं सारे शरीर की चर्बी कम होती है। प्रातः एक गिलास पानी में २ चम्मच शहद घोल कर पिने से भी मोटापा कम होने लगता है। दूध और शुद्ध घी का सेवन बंद करें।

इस प्रकार उपाय करके पेट और कमर का मोटापा घटाया जा सकता है। 
Powered by Blogger.