Hi.
I’m building a site using the Newspaper 6 theme. It’s going great and I’ve been able to do most of what I’ve wanted so far using common sense and this forum. But now I’ve come to a halt.
I’m placing my ads, which I will be selling directly using Adrotate, in custom places not offered by the theme. This post helped me a lot but does not cover all I need.
Frontpage.
The ad banner is in the right place, between my main menu and the big grid. What I’d like to change is to get rid of the gaps between the ad and the big grid so that it looks more wholesome.
Category page.
Basically the same as the frontpage but now I’m also having an issue with the width of the top content banner ad. How would I go about making the banner strech the whole width of the theme but no further as it currently does? Currently it streches the whole width of the screen. Plus, I’d like a more wholesome look, as in the front page, so losing the breadcrumbs, category name and the dropdown that are between the ad banner and the big grid would be excellent.
Posts page.
The location of the ad is right here but I’d like the ad banner to run the whole width of the theme and go directly under the main menu and also above the side menu.
I hope this is clear enough for you to be able to help me.
-
This topic was modified 10 years by
hvatinat.
Hi,
1) In order to get rid of the margin, you can use a bit of css:
.home .td-a-rec-id-custom_ad_1 > div, .home .td-a-rec-id-custom_ad_2 > div, .home .td-a-rec-id-custom_ad_3 > div, .home .td-a-rec-id-custom_ad_4 > div, .home .td-a-rec-id-custom_ad_5 > div{
margin-bottom:0!important
}
2) In order to limit the width of the ad on the category pages and remove the spacing and title/breadcrumb you can use this code:
.category .g-single{
width: 1068px!important;
}
.category .td-a-rec-id-custom_ad_1 > div{
margin-bottom:0!important;
}
.category .td-crumb-container{
display:none!important;
}
.category .td-category-pulldown-filter{
display:none!important;
}
.category .td-category-header .td-page-title{
display:none;
}
.category .td-category-header{
padding-bottom:0!important;
}
3) In order to get the post ad above the content and the sidebar, you will need to edit the theme files and use a do_shortcode function inside the post template you want the ad to be displayed in. For example you can use a theme custom ad 1 spot and add this shortode in each of the loop files coresponding to the post styles you use:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
Ad this code to the very top of the loop file like so:
http://screencast.com/t/76hTfIICn6kS
Make sure you have an ad placed in custom ad 1 .
I hope this helps.
Thank you for your message!
Hi Bogdan. Thanks for the reply.
I’ve implemented the codes you provided and they come close but still not perfect.
1) The ad is now completely up against the big grid. Any chance to get a very small margin, the same as in the big grid it self between the ad and the grid?
2) There is now no space between the menu and the ad. I’d like the default margin to be in place there. Basically what I’m after is that the big banner ad above grids looks like a part of the big grids on the site so I’d like the margin between the ad and the grid to be the same as in the grid itself if that is possible. Also, now the lower banner, under content is full width but is only supposed to be 2/3 or same as the content.
3) The code just appears as text above the banner and does nothing. The banner uses custom_ad_1 so that should not be the issue.
Hello,
1) You can edit the code to your preference. Simply replace the margin-bottom:0!important with
margin-bottom:2px!important;
2) you can add this code unde the mergin-botom part of the code;
margin-top: 2px!important;
3) Please try it again and make sure you have an ad set to custom ad 1 in the theme panel. I tested it again and it works as expected.
Thank you!
Hi Bodgan.
Issues 1 and 2 are now sorted, thanks for the help.
Regarding issue 3, it wasn’t untill I pasted the code you provided into single.php that I got it to work like I wanted to. I then added this code to custom css to adjust the results:
.single .g-single{
max-width: 1068px!important;
}
.single .td-a-rec-id-custom_ad_1 > div{
margin-bottom:2px!important;
margin-top: 48px!important;
}
Can you find any fault with what I’ve done?