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

How to write enqueue_style script to css? from css folder

How to write enqueue_style script to css? using functions.php page ??? using css folder ?

1 Answer

Héctor Muñoz
Héctor Muñoz
18,383 Points

Hi Mohan Babu Vejendla !

To use your own css on your wordpress theme just enqueue it using the wp_enqueue_style function like this. Keep in mind the path of your css.

<?php
function wpt_theme_styles() {
  wp_enqueue_style( 'main_css', get_template_directory_uri() . '/yourcssfile.css' );
}
add_action( 'wp_enqueue_scripts', 'wpt_theme_styles' );
?>

okay thank you