Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress From Bootstrap to WordPress Setup a Bootstrap Theme Add Bootstrap CSS via the functions.php File

Sovathmonyvann Koch
Sovathmonyvann Koch
455 Points

my code not working!

<?php

function theme_styles(){

wp_enqueque_style('bootstrap_css',get_template_directory_uri(). '/css/boostrap.min.css');   
}
add_action('wp_enqueque_style_scripts','theme_styles');

?> i couldn't find the reason why bootstrap.min.css not linked yet i follow everthing like 3 times now still the same

6 Answers

The video didn't say but you have to also put a call into the index.php file to call the head and footer

// hook to put into your index.php <?php wp_head(); ?>

same with where you want to have the footer appear so put the next line at the bottom of index.php <? get_footer(); ?>

Nathan Newell
Nathan Newell
7,634 Points

Hey :) You'll notice that the 'style' text is removed from wp_enqueque_scripts

add_action('wp_enqueque_scripts','theme_styles');

instead of

add_action('wp_enqueque_style_scripts','theme_styles');

Sovathmonyvann Koch
Sovathmonyvann Koch
455 Points

<?php function theme_styles() { wp_enqueue_style( 'bootstrap_css', get_template_directory_uri().'/css/bootstrap.min.css' ); } add_action('wp_enqueue_scripts','theme_styles'); ?> still the same

Nathan Newell
Nathan Newell
7,634 Points

do you have

<?php wp_head(); ?> 

in the head tag of your header.php?

The video didn't say but you have to also put a call into the index.php file to call the head and footer

// hook to put into your index.php <?php wp_head(); ?>

same with where you want to have the footer appear so put the next line at the bottom of index.php <? get_footer(); ?>

The video didn't say but you have to also put a call into the index.php file to call the head and footer

// hook to put into your index.php <?php wp_head(); ?>

same with where you want to have the footer appear so put the next line at the bottom of index.php <? get_footer(); ?>

The video didn't say but you have to also put a call into the index.php file to call the head and footer

// hook to put into your index.php <?php wp_head(); ?>

same with where you want to have the footer appear so put the next line at the bottom of index.php <? get_footer(); ?>