Gewusst wie: laden von bootstrap-Skript und Stil in functions.php (wordpress)?

Wandelte ich die bootstrap-theme für wordpress. Nun, ich habe ein problem beim laden des bootstrap-Skripts und Stil.
Das ist mein code in functions.php

   function wpbootstrap_scripts_with_jquery()
    {

        //Register the script like this for a theme:
        wp_register_script( 'custom-script', get_template_directory_uri() . '/js/bootstrap.js', array( 'jquery' ) );
        wp_enqueue_script( 'samplejs', get_template_directory_uri() . '/js/jquery.min.js', array( '' ) );
            wp_enqueue_script( 'samplejs', get_template_directory_uri() . '/js/clean-blog.min.js', array( '' ) );
        //For either a plugin or a theme, you can then enqueue the script:
        wp_enqueue_script( 'custom-script' );
    }

add_action( 'wp_enqueue_scripts', 'wpbootstrap_scripts_with_jquery' );

und ich füge diese in meine header -

<?php wp_enqueue_script("jquery"); ?>

Zusätzliche Frage:
Was ist der Unterschied zwischen wp_register und wp_enqueue?
Bitte helfen Sie mir. Im Einsteiger in die Verwendung von bootstrap.

InformationsquelleAutor akselrows | 2014-10-27

Schreibe einen Kommentar