Skip to main content

Code Injection on WordPress version

Comments

5 comments

  • Sandra Prunici

    Hi, 

    At the moment, if you want to add some code in header or footer of the site create in WP and make affect also for Brizy pages, you have to add the code into the header section from the theme. If you will add the code through the WP, it would not have some actions on the Brizy pages. For example, Astra theme has the ability to add the Astra Hooks plugin. Here you can find more details.
    Thanks!

    Best regards,
    Sandra

    -1
  • Ulrich Schirm

    Hi sandra,

    I don't quite understand your explanation. I want do add custom code to the <head> section of all pages. I added this code to the header.php file of my theme (Blocksy child). Unfortunately it has no effect.

    How can add custom code to the <head> section of all pages in Brizy Builder?

    Uli

    0
  • Sandra Prunici

    Hi,

    Did the code you added in the header.php has an action on the non-Brizy pages? I checked the Blocksy documentation and they state if you want to add a custom code in the Header part of the site, you should activate the "Custom Code Snippets" and after this add a code snippet globally. For more details, please check this article https://creativethemes.com/blocksy/docs/extensions/custom-code-snippets/.

    Best regards,
    Sandra

    0
  • Ulrich Schirm

    Hi Sandra,

    thanks for the advice. It seemed to me, that Brizy would override the <head> section created by the theme. In fact the <head> section from Brizy is added to the theme's <head>. It turned out the code injection did not work  because I made a syntax error.

    By adding this snippet to the functions.php you can add any code to the <head> section:

    /* Describe what the code snippet does so you can remember later on */
    add_action('wp_head', 'your_function_name');
    function your_function_name(){
    echo("Hello World");
    };
    Background: I need to find a way to make Brizy comply with DGPR requirements. To achieve this I use consent tools like cookiebot.com or usercentrics.com. These services do not run as a WordPress plugin, they run on a different server and need to get connected by code injection. It is important to make sure, the code is inserted to all pages of the domain, so visitors get the chance to give consent, independent on which page they visit first.
     
    Uli
    0
  • Sandra Prunici

    Hi,

    Great! Thank you for updating us regarding this issue!

    We send you a complex message in the previous post about the cookies. See here. Could you please check it?

    Best regards,
    Sandra

    0

Please sign in to leave a comment.