Script immediately after BODY opening

Posted in: Newspaper
Post count: 30

Dear tagDiv Staff,

Many advertising networks require to place ADS script immediately after BODY opening, and common plugins (like Insert Header and Footer plugin) fail to do it with Newspaper theme.
So in the past I used this method with success:

FUNCTIONS.PHP
function custom_content_after_body_open_tag() {
?>
XXX CUSTOM CODE XXX
<?php
}
add_action(‘after_body_open_tag’, ‘custom_content_after_body_open_tag’);

HEADER
<?php do_action(‘after_body_open_tag’); ?>

But now, after I updated Newspaper theme to the latest version, it doesn’t work anymore.

And I have also disabled STANDARD PACK to speed up website, considering that I’m working now only with Cloud Templates stuff, so I cannot use the HEADER of the STANDARD PACK to place the code.

Any suggestions to place Scripts immediately after BODY opening without using STANDARD PACK?

Best Regards,
Marco

Post count: 35449

Hi,

Please make a test and set the codes here to see if this is working.
Also only standard pack can be set in child theme, cloud templates can not.
The code can be set here -> https://i.imgur.com/C2G2WuU.png wp-content/plugins/td-composer/legacy/Newspaper/header.php and it will be load immediately after body starts.

Thank you!

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