• Hi all, spent all day on this, following the treehouse tutorial and its not working. I created this code in functions.php:

    <?php
    
    function fcd_theme_styles() {
    
    	wp_enqueue_style( 'style_css', get_template_directory_uri() . 'style') ;
    
    	wp_enqueue_style( 'style_css', get_template_directory_uri() . '/css/style') ;
    
    	wp_enqueue_style( 'boostrap_css', get_template_directory_uri() . '/css/bootstrap') ;
    
    	wp_enqueue_style( 'style_css', '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i,700,900') ;
    }
    
    add_action('wp_enqeueu_scripts', 'fcd_theme_styles');
    
    function fcd_theme_js() {
    
    	wp_enqeueu_script('', get_template_directory_uri() . '/js/core.min.js', '','', false );
    
    	wp_enqeueu_script('', get_template_directory_uri() . '/js/html5shiv.min.js', '','', false );
    
    	wp_enqeueu_script('', get_template_directory_uri() . '/js/pointer-events.min.js', '','', false );
    
    	wp_enqeueu_script('', get_template_directory_uri() . '/js/script.js', '','', false );
    
    add_action ( 'wp_enqeueu_scripts', 'fcd_theme_js');
    
    }
    
    ?>

    I also added <?php wp_head(); ?> to header.php, and<?php wp_footer(); ?> to footer.php. I cannot for the life of me figure out why my CSS and Javascript files are not loading.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You spelled “enqueue” wrong on the two add_action lines and the script lines. 🙂

    Thread Starter jaatendi

    (@jaatendi)

    Hi Steve, thanks so much! I updated to the correct spelling and I guess I have more than one problem because it is still not working.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    In what way is it not working? If you view the page source, do you see the <link lines that these should produce?

    If you want to learn about theming, I recommend using a solid starter theme, http://underscores.me

    Thread Starter jaatendi

    (@jaatendi)

    Right its not working in that the <link is not appearing in the source code on the front end.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please show the entire file. Use pastebin.com or gist.github.com and paste a link here.

    Thread Starter jaatendi

    (@jaatendi)

    Had to change:

    wp_enqueue_style( ‘style_css’, get_template_directory_uri() . ‘style’) ;

    into:

    wp_enqueue_style( ‘style_css’, get_template_directory_uri() . ‘style.css’) ;

    Thanks for your help!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Trying to enqueue in functions.php’ is closed to new replies.