Hi,
I need to insert Adsense confirmation code into my site, but am at a total loss.
Firstly, I downloaded, installed and activated the child theme: https://theme.co/apex/child-themes
The first question is: should I keep the child theme activated at all times, or can I switch to the main Pro theme? The problem is (one of many, it seems), that I can not upload any images (and apparently not edit any .php files in the editor when the child theme is active).
Secondly, as I understand I need to add the Adsense code into the functions.php file. So I was able to do that by uploading it via ftp, but it is still waiting to be confirmed.
What should it look like? I just deleted the original contents of the file and added my Adsense code.
Then I read from the forums, that I need to paste this into the file:
function add_google_code(){ ?>
<?php } add_action('wp_head', 'add_google_code'); https://theme.co/apex/forums/topic/how-to-connect-google-adsense-under-the-html/ And then I saw this about inserting a script into the header in the child theme. add_action( 'wp_head', 'add_head_script' ); function add_head_script(){ ?><!-- Your adsense scripts will go here -->
<?php
}
The codes are somewhat different in both examples.
I gather that the Adsense code should replace all the " Insert the Google Code here " rows, or âYour adsense scripts will go hereâ Is that all there is? In that case, which of those answers is correct? Does the functions.php file need any other content, as the first time I tried (and am still waiting to see if it will fail, or will be confirmed), I uploaded it as a blank file with only my adsense code in it.
And then again, do I need to have the child theme active in order for it to work, and that Adsense would detect it? Apparently I can not have both the main theme and the child theme active at the same time.
I really want to get this fixed, as I have no idea how long it takes Adsense to confirm the code (apparently a lot), and it is pointless to blindly try different options simply to wait the same amount of time again.