Support » Themes and Templates » Functions.php not working. At a loss of what to do.

  • This is my functions.php file and I can’t get it to import my css:

    <?php
    
        function salt_scripts() {
    		//global $wp_styles;
    		//wp_enqueue_style( 'stylesheet', 'netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css');
    		//wp_enqueue_style( 'stylesheet', 'http://fonts.googleapis.com/css?family=Varela');
    
    		// Loads main stylesheet
            wp_enqueue_style( 'style', get_stylesheet_uri() );
            wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css' );
            wp_enqueue_style( 'bootstrap-theme', get_template_directory_uri() . '/css/bootstrap-theme.min.css' );
            wp_enqueue_style( 'custom-styles', get_template_directory_uri() . '/css/custom-styles.css' );
    	}
    
    	add_action( 'wp_enqueue_scripts', 'salt_scripts' );
    
    ?>
    
    LKDJFLSDKJFLSDKFJSLDKFJ WORK

    I’ve also asked this question on stack-overflow, but I have yet to receive any answers. No idea what I’m missing.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator stephencottontail

    (@stephencottontail)

    I’m guessing that “LKDJFLSDKJFLSDKFJSLDKFJ WORK” isn’t part of your functions.php. Everything looks fine at first glance. Are there any error messages in your server logs? Is your main stylesheet named style.css? Note the singular.

    That random string of text was just to check and see fit it was even being read by WordPress. That’s the only thing that gets imported on any of my pages.

    Yes. my main stylesheet is named style.css. Here is the contents of that if it makes a difference:

    /*
    Theme Name: Salt Solutions
    Theme URI:
    Author: Dustin Dowell
    Author URI:
    Description: A static to WordPress conversion.
    Version: 1.0
    License:
    License URI:
    Tags: salt, solutions
    Text Domain: salt
    */
    
    html,
    body,
    div{
    	background-color: blue; /* test */
    }

    No, there is nothing about my WordPress installation in my server log.

    Moderator stephencottontail

    (@stephencottontail)

    Can you post a link to your website?

    This was the line I needed to fix my problem.

    <?php wp_head(); ?>

    I couldn’t find anywhere in the documentation that said this was required to use functions.php.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Functions.php not working. At a loss of what to do.’ is closed to new replies.