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 Build a WordPress Plugin Building a WordPress Plugin Settings Page Adding CSS to a Plugin Settings Page

challenge task 1 of 2

what is wrong with my work, can some one help?

Create an empty function my_plugin_styles and then use information in comment to enqueue the admin stylesheet

plugin.php
<?php

// Handle: my_plugin_css
// Plugin folder: my-plugin
// CSS file: my-plugin.css

      function my_plugin_styles() {};

          wp_enqueue_style( 'my_plugin_css', plugin_url( 'my-plugin/my-plugin.css' ) ) ;


}


?>

1 Answer

Colin Marshall
Colin Marshall
32,861 Points

On the line where you declare the function, you actually closed the function before you put any code inside of it. So your wp_enqueue_style code is not actually inside your function. You just need to remove two items so that your wp_enqueue_style sits inside of the two curly braces of your function.

Noted.

Jorge

Colin Marshall
Colin Marshall
32,861 Points

Thanks Jorge! I know it's hard when everybody else posts up the answer right away, but I believe we can collectively improve this.

Colin, I totally agree with you. I'll help spread the word. Jorge