How to Insert Adverts in Category

Posted in: Newspaper
Post count: 58

Hi

This is a straight forward question and I hope the answer is likewise. I want to insert ads (Adsense or any other ads) in the top of the category block and at the bottom (above the pagination).

Please see image here: http://tinypic.com/view.php?pic=2samfxl&s=9#.Voafe9Hbiuo

Many Thanks

  • This topic was modified 10 years by colgate.
Post count: 23312

Hello colgate,

If you want to insert ads on your category page it is necessary to use do_shortcode method with the custom ad to achieve this. You should alter this file -> category.php. First of all, you should insert your ad code in Custom Ad 1 field from Theme Panel like this: http://screencast.com/t/fFL1w7Ty and then, with this code -> <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?> you have to add them in the category.php file, like this: http://screencast.com/t/x1oLmljEm and the result you should see here: http://screencast.com/t/K9dbYWkeBfk

Hope this helps and let us know how it goes!

Thank you for the message!

Post count: 45

Hi Catalyn,
When I do follow your instruction I get result here http://www.screencast.com/users/livingnomads/folders/Default/media/14730a31-bee9-4ec2-b2e5-2c52bb45ed1b

, but it look like seem ugly. Plz show me why? Thank you so much!

Post count: 58

The above option does not work. The below seems to be the best option:

Open category.php file

add your adsense code exactly below this line:

<div class="td-pb-span8 td-main-content">

You may also need to force your adsense to be responsive by adding a styling code like one below:

<style>
.ad-name { width: 200px; height: 200px; }
@media (min-width:300px) { .ad-name { width: 200px; height: 200px; } }
@media (min-width:500px) { .ad-name { width: 300px; height: 250px; } }
@media (min-width:900px) { .ad-name { width: 728px; height: 90px; } }
</style>

One thing to remember when updating the theme files to not override these changes.

Hope that helps

  • This reply was modified 10 years by colgate.
  • This reply was modified 10 years by colgate.
  • This reply was modified 10 years by colgate.
Post count: 45

Thank you so much Cogate, but show me where place these code

<style>
.ad-name { width: 200px; height: 200px; }

@media
(min-width:300px) { .ad-name { width: 200px; height: 200px; } }

@media
(min-width:500px) { .ad-name { width: 300px; height: 250px; } }

@media
(min-width:900px) { .ad-name { width: 728px; height: 90px; } }
</style>

P/s: I use drirectly code from Google Adsense, I mean, I not convert to html, so I have to convert to html before insert to Custom_ad_1

Post count: 45

All ads I only used responsive code

Post count: 45

Adsense code need to convert to html code before insert to theme ?

Post count: 58

Ignore the styling, just do this:

Open category.php file

add your adsense code exactly below this line:

<div class="td-pb-span8 td-main-content">

Done!

Regards

Post count: 45

Thank you so much colgate, it work perfectly but this code <div class=”td-pb-span8 td-main-content”> in my category.php appear 2 postion, so have to insert both ?

Post count: 45

But I meet a new problem, after insert code, I get result

http://www.screencast.com/users/livingnomads/folders/Default/media/643eca2c-5aae-454b-864f-8da467e5537b

Botton of Ad too close content below, how to fix this ?

Thank you!

Post count: 58

add a break tag – just one of two of these: <br> exactly under your adsense code.

you may need to just add one tag like this: <br>

or two tags to make the space wider, like this: <br><br>

You can add as many as you like, depending on the space level you want to achieve.

Regards

Post count: 45

Awesome, It work perfectly. Thank you so much colage for guide me 🙂

I have another question, One ad automatic appear on Homepage like this

http://www.screencast.com/users/livingnomads/folders/Default/media/716b9b07-eaad-444d-bbb7-2355dc1afdbf

I don’t know why it appear because I have no insert ads in Homepage, plz help me!

Post count: 58

To remove the ad or change it, you need to edit your homepage.

Regards

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