• Resolved damiendoherty

    (@damiendoherty)


    Hi there.
    Seen a few people having issues recently with this plugin. We’ve been using it for a while on several sites but can’t get it to work on a new one.
    I can see the banner in the code but it is set to ‘display: none’ for some reason.
    Any idea why the banner is not displaying?

    Many thanks

    D

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter damiendoherty

    (@damiendoherty)

    Hello. Just to come back to this. We can see that there is a script that should be loaded with the plugin: cookie-law-info-public.js
    However this is not being loaded. I cant see that our theme is blocking it and there are no errors.
    Is there any reason why this script would not get loaded?

    Many thanks

    D

    Plugin Author WebToffee

    (@webtoffee)

    Hi @damiendoherty,

    Please share your theme file as a zip via this link.

    Thread Starter damiendoherty

    (@damiendoherty)

    Hello
    Thanks for your response. I’ve uploaded the theme as requested.
    Let me know what you think.

    Many thanks

    D

    Plugin Author WebToffee

    (@webtoffee)

    Hi @damiendoherty,

    We have checked the theme and identifie the issue. The WordPress jQuery is reregistered in the theme. You can check this line,
    wp_deregister_script( ‘jquery’ ); from the function docandtee_enqueue_scripts() of the setup.php file (Path : docandtee-bootstrap/inc/setup.php). Our plugin requires jQuery to work properly.

    You can comment the mentioned line from the function and verify the working of the plugin, or please contact the Theme developer.

    Thread Starter damiendoherty

    (@damiendoherty)

    Thank you for your reply.
    Yes you’re correct. We were deregistering jquery in order to load a newer version.
    This has not been a problem with most plugins but I understand that it could be.
    I’ve removed that line for now and your plugin is working correctly.
    Hopefully WordPress will start including a newer version of jquery for everyone!

    Many thanks

    D

    @webtoffee we do have a similare problem we load an other version of jquery 3.12 via an other js script that is use on other sites.
    And therefore we had to deregister jquery

    How can we overide
    wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . ‘js/cookie-law-info-public.js’, array( ‘jquery’ ),$this->version );
    By
    wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . ‘js/cookie-law-info-public.js’,null,$this->version );

    Properly , without having to modify the code of the plugin ?

    ok if change the way the app.js was loaded

    if it can help

    
    function h_remove_jquery() {
        if (!is_admin() ) {
            if ( $GLOBALS['pagenow'] != 'wp-login.php' ) {
                wp_deregister_script('jquery');
    // load custom script that contain jquery 3.2
                wp_register_script( 'jquery',get_stylesheet_directory_uri() . '/web/js/app.js',array() );
            }
        }
    }
    
    add_action( 'wp_print_scripts', 'h_remove_jquery', 100 );
    

    not related but if you also need to remove jquery migrate that won’t be compatible with your version of jquery

    
    
    /* remove jquery migrate if jquery is loaded*/
    /* https://github.com/cedaro/dequeue-jquery-migrate/blob/develop/dequeue-jquery-migrate.php */
    function cedaro_dequeue_jquery_migrate($scripts)
    {
        if (!is_admin() && !empty($scripts->registered['jquery'])) {
            $jquery_dependencies = $scripts->registered['jquery']->deps;
            $scripts->registered['jquery']->deps = array_diff($jquery_dependencies, array('jquery-migrate'));
        }
    }
    
    add_action('wp_default_scripts', 'cedaro_dequeue_jquery_migrate');

    `

    • This reply was modified 3 years, 7 months ago by pasnous.
    • This reply was modified 3 years, 7 months ago by pasnous.
    Plugin Author WebToffee

    (@webtoffee)

    Hi @damiendoherty,

    Please check and see if the code snippet here would be helpful.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Banner not displaying’ is closed to new replies.