Different Header ads according to category

Posted in: Newsmag
Post count: 6600

Hi,

Please provide all steps and the code you have used to do this so we can review it and hopefully we will find where the issue is.

Thank you!

Post count: 5

Thank you for your response Luclan, and Happy Unification day.

Ads Configuration:

Custom Ad 1

Ad.php Code:

<div class="td-header-rec-wrap">
<?php
$tds_header_ad_title = td_util::get_option('tds_header_ad_title');

// show the header ad spot
if (is_category('Food')){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
echo td_global_blocks::get_instance('td_block_ad_box')->render(array('spot_id' => 'header', 'spot_title' => $tds_header_ad_title)); ?>

</div>

Thank you in advance.

Post count: 23312

Hello redtrain,

The code seems to be correct. Is it working? If is not, please let us know so we do some closer investigations.

Thanks for the message!

Post count: 5

Hi Catalina,

Nothing is displaying on the page http://giblad.com/category/food/ unfortunately.

It doesn’t seem to be working.

Thank you

Post count: 6600
Post count: 5

Thank you Lucian, sorry to disturb you again…

I have tried that now and I can see the ad! But it’s very small as per this screenshot: https://postimg.org/image/78wj7npcd/

Here’s the original size: http://giblad.com/wp-content/uploads/2017/01/GIB-LAD3.jpg

Can you help? Thanks for all your assistance

Post count: 23312

Hello redtrain,

Provide your website so I can take a closer look and also, so I will be able to provide a more accurate response.

Thanks for the message!

Post count: 31

it works.

I can insert the banner in all the articles of the category?

ex:

site.com/fashion/ Ok it works [custom_ad_1]

site.com/fashion/article1 now it does not work [custom_ad_1]
site.com/fashion/article2 now it does not work [custom_ad_1]
site.com/fashion/article3 now it does not work [custom_ad_1]

Post count: 23312

Hello giulian curl,

You should provide your website URL so I can inspect it closer where is the problem with your Ads.

Thanks for your understanding!

Post count: 31

<?php
if (in_category(array(‘salute’))){
echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘);
}
else{
locate_template(‘parts/header/ads.php’, true);
}
?>

Use header-style-7, and with this code works fine.

Post count: 23312

Hello giulian curl,

You should use the above method which has presented above. I have tested on my side and work as properly.
-> https://www.screencast.com/t/Ji15dhlRbGlE Try using this method because it is tested and work as expected.

Thanks for your understanding!

Post count: 22

Hi, how are you? Can we do the same for the footer? Because if I got to the Header directory I will find the ads.php file, but if I go to the footer’s directory, there is no Ads.php file.

Thanks!

Post count: 23312

Hello fernando,

Please notice that Footer section does not have any ads implemented, sorry! If you want to add some ads in this section, you should use the Ads Box from the Widgets section and add it in Footer1,2,3, according to our Footer template used by you. If you want to apply some rules for your footer section, you should edit the footer.php core file. Also, you can use the do_shortcode method for insert some ads in this regard, according to the following documentation here -> https://developer.wordpress.org/reference/functions/do_shortcode/
Notice that is not a simple task 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!

Hope this helps!

Thanks fro your understanding!

Viewing 13 posts - 26 through 38 (of 38 total)
You must be logged in to reply to this topic.