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.
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!
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!
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
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
But I meet a new problem, after insert code, I get result
Botton of Ad too close content below, how to fix this ?
Thank you!
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
Awesome, It work perfectly. Thank you so much colage for guide me 🙂
I have another question, One ad automatic appear on Homepage like this
I don’t know why it appear because I have no insert ads in Homepage, plz help me!