user2055788
user2055788

Reputation: 361

CSS is not working in wordpress

I am new to wordpress and I am converting html template to wordpress. I have included all css files in functions file but css is not working. All css files are in css folder. Below is the code:

<?php
if (!isset($content_width)){
$content_width = 660;}
function softech_setup(){
add_theme_support('automatic-feed-links');
add_theme_support('title-tag');}
add_action('after_setup_theme', 'softech_setup');
function softech_scripts(){ 
/*Add Styles*/
wp_enqueue_style('all-css', get_template_directory_uri() . '/css/all.css');
wp_enqueue_style('font-awesome-css', get_template_directory_uri() . '/css/font-awesome.min.css');
wp_enqueue_style('bootstrap-css', get_template_directory_uri() . '/css/bootstrap.css');
wp_enqueue_style('animate-css', get_template_directory_uri() . '/css/animate.css');
wp_enqueue_style('color-css', get_template_directory_uri() . '/css/color/color.css');
wp_enqueue_style('settings-css', get_template_directory_uri() . '/rs-plugin/css/settings.css.css');

/*Add Scripts*/
wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), true );
wp_enqueue_script('jquery-1.11.3.min-js', get_template_directory_uri() . '/js/jquery-1.11.3.min.js', array('jquery'), true);
wp_enqueue_script('jquery-main-js', get_template_directory_uri() . '/js/jquery.main.js', array('jquery'), true);
wp_enqueue_script('jquery-plugins-js', get_template_directory_uri() . '/js/plugins.main.js', array('jquery'), true);
wp_enqueue_script('jquery-themepunch.tools-js', get_template_directory_uri() . '/rs-plugin/js/jquery.themepunch.tools.min.js', array('jquery'), true);
wp_enqueue_script('jquery-themepunch.revolution-js', get_template_directory_uri() . '/rs-plugin/js/jquery.themepunch.revolution.min.js', array('jquery'), true);
}
add_action('wp_enqueue_scripts ', 'softech_scripts');
?>

Upvotes: 0

Views: 217

Answers (4)

A. R. Jones
A. R. Jones

Reputation: 73

Try the wp_register_style function. https://codex.wordpress.org/Function_Reference/wp_register_style

wp_register_style('all-css', get_template_directory_uri() . '/css/all.css');

wp_enqueue_style('all-css');

Upvotes: 0

Samyappa
Samyappa

Reputation: 531

Check Your page source.

Rightclick -> Goto-> view page source.

In page source check your style sheet url.

Upvotes: 1

metad00r
metad00r

Reputation: 134

Check if you correctly include the following functions:

1. in header.php

<head>
<?php wp_head(); ?>
</head>

2. in page.php, single.php, home.php

<?php get_header(); ?>

<?php get_footer(); ?>

3. In footer.php (before the </body></html> tag)

<?php wp_footer(); ?>

Upvotes: 1

Virendra Nagda
Virendra Nagda

Reputation: 658

use get_stylesheet_uri() instead of get_template_directory_uri()

Upvotes: 0

Related Questions