0

Here is my code that is not working in wordpress theme. using this code trying to getting style.css file from wp root folder. what's problem in this code is any thing not correct like function name

<?php
function add_style() { wp_enqueue_style('style', get_stylesheet_uri()); }
add_action('wp_enqueue_scripts','add_style');
?>

But this code in wp function file is working correctly

register_nav_menus(array(
    'primary' => __('Primary Menu')
    )) ;

So can any one help me ?

2 Answers 2

1
<link href="<?php bloginfo('stylesheet_url');?>" rel="stylesheet">

add this to your header.php

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

Comments

1
function custom_scripts_method() {

  /*  CSS  */
  wp_enqueue_style( 'boostrap-style', get_template_directory_uri().'path to file from theme folder' ); 

}       

add_action( 'wp_enqueue_scripts', 'custom_scripts_method' );

?>

add this in the functions.php file

and remember to use the : <?php wp_head(); ?> in the head of your html

2 Comments

Please don't post only some code as an answer. It's better to also explain what's wrong and how your code fixes the problem.
Thanks @Alexander I solve my problem I am trying to apply css on index.php without using wp_Head() thanks

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.