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

Show/hide button on featured post

Hi, So i currently have a project where i need to make a click-able show/hide button on a featured post on a wordpress theme. Can anyone help me with this im not sure if the best way to do it is with j query. I would be grateful if anyone could help me as my j query knowledge at the moment is very low

3 Answers

Kevin Korte
Kevin Korte
28,149 Points

Look at jquery's toggle method. Sounds like it'll do what you need.

I made this ugly thing for another question just to show how it works.

http://codepen.io/anon/pen/znwAy

Thanks i assume you mean this one http://api.jquery.com/toggle/ . Ill read through the documentation and hopefully i can figure it out.

Kevin Korte
Kevin Korte
28,149 Points

Yes, that should allow you to toggle between a show and hide state.

Ok cool. Thanks for that i just needed pointing in the right direction :)

Kevin Korte
Kevin Korte
28,149 Points

You're welcome. No problem