0

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');
?>
1
  • You need to post what errors you are getting. Also try debugging the code by removing all the lines of code (except <?php and ?>), then adding them back in one by one. Commented Feb 8, 2016 at 10:50

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

I can't believe this mistake, LOL. Thank you !
That happens to everybody :D
1

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

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.