Advertising Block in Category Page

Posted in: Newsmag
Post count: 24

Hi. How to add Advertising Block after 4 posts in category page in NewsMag theme? Only create Page with Visual Composer?

Post count: 23312

Hello ytre77,

Unfortunately, our theme does not have any such an option that allows you to add ads for category pages. If you want to add some ads there, you should edit the category pages and use do_shortcode method, like this ->
<?php echo do_shortcode (‘[td_block_ad_box spot_id=”custom_ad_1″]’); ?> -> https://www.screencast.com/t/gBZ5dwc4OJ

Thanks for your understanding!

Post count: 24

Thanks. Does the do_shortcode() method match me, just which file do I edit? This one in the link to the screen is one entry I guess? Need to check first in some loop of the number which in the order in the list is the entry and if 4 is followed by it do_shortcode ();
like this:
<?php
$postnum = 0;
while(have_posts()) : the_post();
if($postnum == 3) {
echo do_shortcode (‘[td_block_ad_box spot_id=”custom_ad_1″]’);
$postnum = 0;
}
//view another category entry
$postnum++;
endwhile;
?>

PS. Sorry for my bad english.

Post count: 23312

Hello ytre77,

If you will check by above screenshot, there you will see the folder name which has to be edited if you want to add some ads to your category pages. This is a simple example but if you want to display more levels in our theme and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom services at the moment, sorry!

Thanks for your understanding!

Post count: 31

Hello,

I try to place your code on the category template.
For example, i use the 7′ template category. The code it’s next:
Where i must add the short code <?php echo do_shortcode (‘[td_block_ad_box spot_id=”custom_ad_1″]’); ?>

I try to add on the end but he broke my page!

<?php
class td_category_template_7 extends td_category_template {

function render() {
?>

<!– subcategory –>
<div class=”td-category-header td-container-wrap”>
<div class=”td-container”>
<div class=”td-crumb-container”><?php echo parent::get_breadcrumbs(); ?></div>
<div class=”td-category-title-holder”>

<h1 class=”entry-title td-page-title”><?php echo parent::get_title(); ?></h1>
<?php echo parent::get_description(); ?>

</div>
<div class=”td-pulldown-container”><?php echo parent::get_pull_down(); ?></div>
</div>
</div>

<?php
}
}

Post count: 22421

Hello,

Newsmag does not have a category template 7. If you use newspaper, then add the code like so: https://www.screencast.com/t/bX0W7VFQEh
Use this code as the one above was not wrapped in the code tags:
<?php echo do_shortcode ('[td_block_ad_box spot_id="custom_ad_1"]'); ?>

Thank you!

Post count: 31

OK, That’s work.

Many thank’s

Post count: 6

Are you find any solution of the problem?

Post count: 31

Hy,

I solve the problem with the sugestion of the tagdiv team.
how you can see that was worked for me.

Post count: 59

Sorry, I’m working with the td_category_template_2.php and I want to place the ad shortcode after 6 articles but the code placed as suggested is not working. Is not something that I have to display in article display view template td_module_5.php as I want to put the Ad after 6 posts?
Thanks

Post count: 59

Ok, solved putting in loop.php
http://prntscr.com/inu4cj

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