Hallo,
ich habe die Javascripts mit jquery sowie die CSS-Dateien vom wp_head in den wp_footer verlegt. Funktioniert auch. Jetzt möchte ich, dass im Footer die CSS-Dateien vor den Javascripten aufgerufen werden. Gibt es da eine Möglichkeit?
Meine Programmierung in der funtion.php sieht im Moment so aus:
PHP
/* Remove scripts and styles form head too footer */
remove_action('wp_head', 'wp_enqueue_style', 1);
remove_action('wp_head', 'ratings_javascripts_header');
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_enqueue_style', 5);
add_action('wp_footer', 'ratings_javascripts_header');
add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer', 'wp_print_head_scripts', 5);
/* Remove jquery from head too footer */
if ( !is_admin() ) wp_deregister_script('jquery');
function my_init()
{
if (!is_admin())
{
wp_deregister_script('jquery');
// Load the copy of jQuery that comes with WordPress
// The last parameter set to TRUE states that it should be loaded
// in the footer.
wp_register_script('jquery', '/wp-includes/js/jquery/jquery.js', FALSE, '1.11.0', TRUE);
wp_enqueue_script('jquery');
}
}
add_action('init', 'my_init');
Alles anzeigen