• Resolved JustinCallaghan

    (@justincallaghan)


    Hi,

    I have installed an ePrivacy script to show my website’s cookie consent pop up in my footer but it is showing underneath the footer. I have a child theme and copied the footer php file to it.

    Please may you advise how I get the script to show above the footer.

    Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter JustinCallaghan

    (@justincallaghan)

    The website in question is JustinCallaghan.com – the current theme allows the script but I wish to use the Customizr theme and the footer.php is different and doesn’t work the same.

    Thanks.

    Being an avid supporter of AVFC, I don’t provide support to Baggies fans.
    Oh alright, I’ll try to ignore that. ??

    Czr is an object-oriented design so doesn’t use the traditional WP structure eg footer.php.

    The usual way to customise is to use a child theme and add functions using the Hooks API into the functions.php and/or styling via style.css. You can look at the Snippets and see how that is done.

    I can’t see anything visually so can’t move with CSS. Can you leave details of the script you added please?

    Thread Starter JustinCallaghan

    (@justincallaghan)

    Hi,

    Thank you for your reply. The ePrivacy script works in the Vantage Theme which looks like this:

    <?php do_action( ‘vantage_main_bottom’ ); ?>
    </div><!– .full-container –>
    </div><!– #main .site-main –>

    <?php do_action( ‘vantage_after_main_container’ ); ?>

    <?php do_action( ‘vantage_before_footer’ ); ?>

    <?php get_template_part( ‘parts/footer’, apply_filters( ‘vantage_footer_type’, ” ) ); ?>

    <?php do_action( ‘vantage_after_footer’ ); ?>

    </div><!– #page-wrapper –>

    <?php do_action(‘vantage_after_page_wrapper’) ?>
    <script src=”https://www.dwin2.com/pub.119988.min.js”></script&gt;
    <script>AWIN.Privacy();</script>
    <?php wp_footer(); ?>
    </body>
    </html>

    But for the Customizr Theme is underneath the footer section therefore does not allow a visitor to choose an option This is the footer.php from my child theme of Customizr:

    <?php
    /**
    * The template for displaying the footer.
    *
    *
    * @package Customizr
    * @since Customizr 3.0
    */
    do_action( ‘__before_footer’ ); ?>
    <!– FOOTER –>
    <footer id=”footer” class=”<?php echo tc__f(‘tc_footer_classes’, ”) ?>”>
    <?php do_action( ‘__footer’ ); // hook of footer widget and colophon?>
    </footer>
    </div><!– //#tc-page-wrapper –>
    <?php
    do_action( ‘__after_page_wrap’ );
    wp_footer(); //do not remove, used by the theme and many plugins
    do_action( ‘__after_footer’ ); ?>
    <script src=”https://www.dwin2.com/pub.119988.min.js”></script&gt;
    <script>AWIN.Privacy();</script>
    </body>
    <?php do_action( ‘__after_body’ ); ?>
    </html>

    I appreciate your help with this.

    Thanks
    Justin

    Thread Starter JustinCallaghan

    (@justincallaghan)

    Hi rdellconsulting,

    I have looked into the hooks api but cannot work out how to add the script of:

    <script src=”https://www.dwin2.com/pub.119988.min.js”></script&gt;
    <script>AWIN.Privacy();</script>

    to make it work above the footer. I currently have the script working on justincallaghan.com on a different theme – would it be possible to take a look when free and see how you think I could add this to the Customizr child theme?

    Regards
    Justin

    I’ve flagged to @d4z who’s away for the weekend. Should pickup tomorrow.

    Thread Starter JustinCallaghan

    (@justincallaghan)

    Thanks a lot.

    Hello,
    where do you place that script?
    You should place it in the wp_footer using hook, it’s the safe way.
    Here’s an example:
    https://volatylthemes.com/footer/
    So in your child-theme functions.php you should put:

    add_action( 'wp_footer', 'privacy_script' );
    // Add scripts to wp_footer()
    function privacy_script() { ?>
      <script src="https://www.dwin2.com/pub.119988.min.js"></script>
      <script>AWIN.Privacy();</script>
    <?php }

    This just to correctly use wordpress themes.

    About your issue, are we talking about the fact that the privacy icon isn’t visible?
    It’s just a matter of CSS z-index, so in your custom css put:
    #aw_jl_icon.awin { z-index: 100; }
    or something of the sort.

    Hope this helps.

    Thread Starter JustinCallaghan

    (@justincallaghan)

    Hi,

    Thank you very much for taking the time to reply. I have actioned the above and the icon is now visible, thanks very much for that. When I load the website the ePrivacy script normally loads a box to allow the visitor to choose whether to accept yes or no on the cookies.

    It doesn’t open automatically – would you know why that is at all please?

    Appreciate your help on this.

    regards
    Justin

    I think it doesn’t open automatically ’cause you already saw it, so a cookie has been stored.
    Clean the browser’s cache, remove cookies or use a totally different browser.

    Hope this helps.

    Thread Starter JustinCallaghan

    (@justincallaghan)

    Yes that’s great thanks a lot.

    Glad you solved ??
    Would you mind marking this topic as resolved?
    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘ePrivacy script showing under footer’ is closed to new replies.