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

Adam Sommer
Adam Sommer
62,470 Points

Adding AJAX To Plugins on the Front-End

Wondering what the path to the front-end.css file should be? I'm trying all kinds of combinations of plugins_url('front-end.css'), but it keeps saying I'm wrong?

6 Answers

Sean Templeton
Sean Templeton
12,983 Points

Yes, I just had this problem as well. The challenge does not provide good description as to where it is located. Think about where a stylesheet SHOULD be placed. Also, don't forget where your plugin files are located. You are on the right track though.

Adam Sommer
Adam Sommer
62,470 Points

I think I forgot where my plugin files are located, because I still can't seem to find the directory. I've tried 'my_plugin/css/front-end.css', 'my_pluign/front-end.css', 'my_plugin/inc/front-end.css', etc all wrapped in the plugins_url() but still all wrong answer???

Sean Templeton
Sean Templeton
12,983 Points

What did How did Zac name his plugin folder?

Luke Wenke
Luke Wenke
32,294 Points

Almost right.... Zac uses dashes rather than underscores in the path

Sean Templeton
Sean Templeton
12,983 Points

How did Zac name his plugin folder?

Adam Sommer
Adam Sommer
62,470 Points

wptreehouse-badges?

Sean Templeton
Sean Templeton
12,983 Points

Yes. Now from that, figure out what the plugin's folder is from the code challenge.

Adam Sommer
Adam Sommer
62,470 Points

I'm still not getting it... all the other code challenges used something with my_plugin in the path?

Sean Templeton
Sean Templeton
12,983 Points

Yes, this code challenge does not follow any standard way of coding that has been established through previous challenges. The name of the plugin is My Plugin. The name of Zac's plugin is WPTreehouse Badges. Use Zac's way of naming his plugin folder.

Adam Sommer
Adam Sommer
62,470 Points

Oh my god, I'm going to cry... why would they do that to me!!!!!

Thanks for your help Sean, finally got the path right.

Sean Templeton
Sean Templeton
12,983 Points

I had the exact same reaction. I'm glad you got it. :)

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

This should be resolved now. Sorry for the complications!

Adam Sommer
Adam Sommer
62,470 Points

Thanks so much Zac. And thanks for the great course. Almost have my own plugin done. Would have taken far far longer without your great content.

Did this revert after the database work last night? I'm still having issues. I've noticed the DB work caused some other things to revert, so I'm wondering if this did too.

I've tried:

  • plugins_url('front-end.css')
  • plugins_url('my-plugin/front-end.css')
  • plugins_url('my-plugin/inc/front-end.css')
  • plugins_url('front-end.css', 'my-plugin') Based on the Codex
  • plugins_url('front-end.css', __FILE__) Based on the Codex
Sean Templeton
Sean Templeton
12,983 Points

Must have, it's back to the issue we had before. You almost had it though. Look at what sub-folder you put it in.

Zac Gordon
Zac Gordon
Treehouse Guest Teacher

Double checking if there was a rollback on this for some reason

Yes. It looks like that fix was lost in the DB migration. I have re-fixed it. Sorry all!