Changes custom ad

Posted in: Newspaper
Post count: 44

I’ve updated to the latest version of Newspaper and now my custom code for rewriting ad div class doesn’t work anymore.
I want to rename the custom_ad_x part to custom_new_x and the code below used to work just fine in /wp-content/plugins/td-composer/legacy/Newspaper/includes/shortcodes/td_block_ad_box.php in the function render_ads, line 1937

$buffy = ”;

$check_css_name = array(‘custom_ad_1’, ‘custom_ad_2’, ‘custom_ad_3’, ‘custom_ad_4’, ‘custom_ad_5’);
if (in_array($spot_id, $check_css_name)){ $spot_id = str_replace(“ad”, “new”, $spot_id); }

$buffy .= ‘<div class=”td-a-rec td-a-rec-id-‘ . $spot_id . $align . ‘ ‘

Any idea why the replace function isn’t working anymore, or how I could go about changing the output of the custom_ad css in ad boxes?

Post count: 22421

Why not simply change the css associated with a class rather than changing the entire class? We do not recommend changing class names as it will break the theme functionality. Use css to rewrite the rules if styling is what you are after. What is it you are trying to achieve as an end result?

Post count: 44

Sorry, it’s working fine after all. Something went wrong with the changes I made earlier, causing the uploaded file to comment out all my modified code instead of only my code comment.

Apologies for wasting your time on this.

  • This reply was modified 7 years by ronnie.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.