I'm creating wordpress theme by myself, but my functions.php doesn't work properly. I think there are a lot posts of this question, but I can't find proper one.
How I should fix it ?
My Code:
<?php
// Register Custom Navigation Walker
require_once('wp_bootstrap_navwalker.php');
register_nav_menus( array(
'primary' => __( 'Pagrindinis Menu', 'Harionew' ),
) );
function apdaila_scripts() {
wp_enqueue_style( 'blain-basic-style', get_stylesheet_uri() );
wp_enqueue_style( 'apdaila-bootstrap-style', get_stylesheet_directory_uri()."/css/bootstrap.min.css", array('apdaila-fonts','apdaila-layout') );
wp_enqueue_style( 'apdaila-main-style', get_stylesheet_directory_uri()."/css/main.css", array('apdaila-fonts','apdaila-layout') );
wp_enqueue_script('apdaila-collapse', get_template_directory_uri() . '/js/collapse.js', array('jquery') );
wp_enqueue_script( 'apdaila-bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery') );
wp_enqueue_script( 'apdaila-jquery', get_template_directory_uri() . '/js/jquery-1.12.0.min.js', array('jquery') );
}
add_action('wp_enqueue_script','apdaila_scripts');
?>
add_action( 'wp_enqueue_scripts', 'themeslug_enqueue_style' );
You have used wrong hook. Use 'wp_enqueue_scripts'
您在钩子wp_enqueue_scripts中错过了一个“ s”,它应该是add_action('wp_enqueue_scripts','apdaila_scripts');
You have write wrong hook for add scripts.
Please replace this line
add_action('wp_enqueue_script','apdaila_scripts');
to this line
add_action('wp_enqueue_scripts','apdaila_scripts');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.