How to Enter Ads in tag.php File

Posted in: Newspaper
Post count: 58

Hi tagDiv team,

Could you please let me know how to enter an adsense code to the tag.php file.

the adsense code needs to be at the end of the page and above the pagination on the page.

I have tried, but when entering any code after <?php it kills the theme.

</div>
                                <?php
                                $td_tag_description = tag_description();
                                if (!empty($td_tag_description)) {
                                    echo '<div class="entry-content">';
                                    echo $td_tag_description;
                                    echo '</div>';
                                }
                                locate_template('loop.php', true);

                                echo td_page_generator::get_pagination();
                                ?>
                            </div>

Many Thanks

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

Hello,
You will have to place the adsense in the theme panel in one of the ad spots (for example custom ad 1) adn then use the do_shortcode function in the php file:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?>
Hope this helps.
Thanks.

Post count: 58

Thanks for that Bogdan. I will try that out and let you know.

Regards

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