Functions.php not working. At a loss of what to do. (5 posts)

  1. dustindowell
    Posted 1 year ago #

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

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

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

  2. stephencottontail
    Posted 1 year ago #

    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.

  3. dustindowell
    Posted 1 year ago #

    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 URI:
    Tags: salt, solutions
    Text Domain: salt
    	background-color: blue; /* test */

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

  4. stephencottontail
    Posted 1 year ago #

    Can you post a link to your website?

  5. dustindowell
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic