• Resolved sousouch

    (@sousouch)


    Hi,

    When I add bootstrap with wp_enqueue_style/script the search no longer works.

    Do you know how to fix it?

    Thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    Can you please add a URL where I can check the issue?
    What scripts/styles are exactly enqueued?
    Can you please share the exact code?
    Are there any errors reported on the server side, or the client side?

    Thanks,
    Ernest M.

    Thread Starter sousouch

    (@sousouch)

    Hi,

    I work locally.

    Here is the code:

    function bs_styles_scripts(){
    		wp_enqueue_style('bootstrap4', 'https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css');
    		wp_enqueue_script( 'boot1','https://code.jquery.com/jquery-3.3.1.slim.min.js', array( 'jquery' ),'',true );
    		wp_enqueue_script( 'boot2','https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js', array( 'jquery' ),'',true );
    		wp_enqueue_script( 'boot3','https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js', array( 'jquery' ),'',true );
    }
    add_action('wp_enqueue_scripts', 'bs_styles_scripts');

    There is a priori no error.

    Thanks

    Plugin Author wpdreams

    (@wpdreams)

    You are enqeueing a second jQuery instance on line 2 (juery slim), whereas in wordpress there is a jQuery already enqeued in the header. That will completely remove all prior jQuery extension registrations and cause a major conflict – with any other script as well.
    If you remove that, it should resolve the issues.

    Thread Starter sousouch

    (@sousouch)

    It works.

    Thanks

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

The topic ‘Bootstrap’ is closed to new replies.