How to Add Adsense Codes Below Menu?

Posted in: Newspaper
Post count: 28

Hello,
I want to add the Adsense ad codes below the main menu. How can I add it?
I want the ad to appear on all the pages of the website.

Here’s my site – http://www.bestof2016hq.com

Also, I want to know how to add columns in an article. There is no shortcode for that?

Post count: 23312

Hello heisenberg234,

If you want to insert the ad under the main menu bar, you have to use the do_shortcode method. Please follow the below tutorial ->>

This is the right order to display the ad using do_shortcode function:
I will use custom ad 1 as example:
– paste the ad code in theme panel > ads. custom ad 1: http://screencast.com/t/I4fGyfFoyc
– get the ad spot’s shortcode. To get the shortcode add an ad box into a blank page then switch in back-end editor copy and paste this code: http://screencast.com/t/Kcqsjk9C7xbU inside do_shortcode function.
– paste the code which renders the shortcode in the file corresponding with the header style used.
For example, if you’re using header style 1 the file which must be edited is header-style-1.php http://screencast.com/t/itasx4W4Thttp://screencast.com/t/5vAMrfFwW

<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>

Thanks!

Post count: 28

Thanks. I will give it a try right now.
And how to add columns in posts? There is no shortcode for that in the visual editor.

Post count: 28

Hey,
I didn’t use the shortcode method as it’s too confusing.
I just copied the Adsense code and pasted it in the header file and it worked.
Will this be okay?

Post count: 23312

Hello heisenberg234,

Yes, it is okay in your case. Above, I gave you an example with do_shortcode because this kind of method offers you the way to add the ads anywhere on the site and you can use it when you do not have an option from Theme panel.
If you need only 2 columns in your post content, you can set it from editor, like this -> http://screencast.com/t/bhNecroT and if you need more than 2 columns, you have to create the code from Visual Composer editor and then you have to copy/paste the code in the HTML source of the post, like this -> http://screencast.com/t/UJfUJPnz -> http://screencast.com/t/rnuVk21z6oQj -> http://screencast.com/t/hlK5SRP4SoA
and the result you should see here -> http://screencast.com/t/bo0oqWUQcb

Hope this helps!

Thank you for the message!

Post count: 28

Thanks a lot for all the help! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.