Baivaras February 2016

Functions.php file doesn't read stylesheet in wordpress

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');
?>

Answers


WisdmLabs February 2016

add_action( 'wp_enqueue_scripts', 'themeslug_enqueue_style' );
You have used wrong hook. Use 'wp_enqueue_scripts'


jameshwart lopez February 2016

You missed an 's' in your hook wp_enqueue_scripts that should be add_action('wp_enqueue_scripts','apdaila_scripts');


Jalpa February 2016

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');

Post Status

Asked in February 2016
Viewed 2,365 times
Voted 10
Answered 3 times

Search




Leave an answer