Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter al123sl

    (@al123sl)

    Hi Ben,
    Thank you very much.
    Yeah, I removed the Id, so that it is not seen in the forum, even though it doesn’t matter. OK, basically I needed to put the entire code in the place of “script goes here”.
    I got the idea now, I tried it and it works fine with GTM on the right places. 🙂

    Thank you very much for your support. I am very happy.

    Kind Regards,
    Alex

    Thread Starter al123sl

    (@al123sl)

    Hi Ben,

    OK that sounds nice, thank you.
    Here is the 2nd GTM code I want to put right after the opening body tag:

    <!– Google Tag Manager (noscript) –>
    <noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=&#8221;
    height=”0″ width=”0″ style=”display:none;visibility:hidden”></iframe></noscript>
    <!– End Google Tag Manager (noscript) –>

    Thank you,
    Alex

    Thread Starter al123sl

    (@al123sl)

    Hi Ben and thank you for your reply,
    As I am not quite literate in codes, I entered your function above in my generated functions.php child theme file through the CMS before the “if ( !function_exists( ‘chld_thm_cfg_locale_css’ ) )”. It then gave me “missing_content” and after refreshing the browser your function disappeared from my generated functions.php file I pointed above.
    I guess you meant that I can only make a functions.php file with your function above to load the second GTM code immediately after the opening body tag? OK, I entered the first GTM code in the head part of the “header-and-footer-scripts-inserter plugin”. Did you mean that I have to enter the second GTM code after the ‘script goes here’; in your function in my child theme functions.php file, so that the second GTM code can be loaded after the opening body tag? I actually don’t know where to enter the second GTM code for the opening body tag?
    Thank you for your time
    Alex

    Thread Starter al123sl

    (@al123sl)

    Hi Ben,
    Thank you for your reply.
    Yeah, I would like to put the second GTM code after the opening body tag, but I cannot find it in the theme files?
    Here is the functions.php file from my child theme, that was generated with Child Theme Configurator:

    <?php
    // Exit if accessed directly
    if ( !defined( ‘ABSPATH’ ) ) exit;

    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED – Do not modify or remove comment markers above or below:

    if ( !function_exists( ‘chld_thm_cfg_locale_css’ ) ):
    function chld_thm_cfg_locale_css( $uri ){
    if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . ‘/rtl.css’ ) )
    $uri = get_template_directory_uri() . ‘/rtl.css’;
    return $uri;
    }
    endif;
    add_filter( ‘locale_stylesheet_uri’, ‘chld_thm_cfg_locale_css’ );

    // END ENQUEUE PARENT ACTION

    What do you think about the functions.php file?
    If it is not suitable I could maybe try to generate one from WP codex?
    Thank you for your responsiveness
    Best regards,
    Alex

    Thread Starter al123sl

    (@al123sl)

    Hi Ben and thank you for your answer!
    Yeah, I will consider using the premium version in the future, but now I want to start with the free version.
    Well, I tried to put the function you wrote above in the functions.php file in the child theme, but it gave me all the time “missing_content” and it did not allow me to modify the functions.php file.
    Otherwise the plugin “Head and Footer Scripts Inserter” fires well without actually the need to use the function in the functions.php file, but it puts the second GTM code after the </footer> tag. Do you think it’s OK to be like that, or I can maybe have another solution?
    Thank you for your assistance in advance

    Kind Regards,
    Alex

    Thread Starter al123sl

    (@al123sl)

    Hi emranemranx,
    I also wish you a nice day!
    Thank you!

    Thread Starter al123sl

    (@al123sl)

    Hi and thank you for your answer!
    Yeah, I reinstalled the theme and it was the same until I deactivated Hueman Addons plugin. Now the header changes as it should.
    Thank you for your advice

Viewing 7 replies - 1 through 7 (of 7 total)