From the course: WordPress: Action and Filter Hooks

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Adding a custom style sheet

Adding a custom style sheet - WordPress Tutorial

From the course: WordPress: Action and Filter Hooks

Start my 1-month free trial

Adding a custom style sheet

- [Instructor] Now that we've got the skeleton for our plugin, so to speak, let's look at adding a custom style sheet. First I need to create a style sheet. So from my plugin folder single-post-cta I'll say new style, and I'll just name my file spc-styles.css. Make sure to save it in that root directory and then just clear this out. I'm going to add one class in here and we'll call it very creatively spc. And set maybe a background color and a font color just for giggles. Okay, so we've got a style sheet. The next step is to add it to our site. And to do that, let's start with a custom function over here in our main plug in file, and we'll call it function spc_load_stylesheet and this is the function we'll use to load up our style sheet as the name implies. So this is a custom function, you could name it anything that you wanted, but of course being meaningful with the naming helps as well as having this custom…

Contents