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 trialBen Goldman
14,626 PointsHow to change order of portfolio pieces/images?
I did the Wordpress Custom Theme lesson, and I was wondering how to change the order of the pieces in the portfolio project? When you add a new portfolio piece, it is automatically added to the top of the list, pushing the rest of the items one to the left. Ideally, I'd like to have the same four images displaying on the front page. On the portfolio page, the order isn't important to me.
Appreciate any suggestions. Thanks!
2 Answers
Zac Gordon
Treehouse Guest TeacherCheck out the Order and Orderby Parameters for WP_Query: http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
Ben Goldman
14,626 PointsThanks, Zac. I'll make sure and check that out. I really got a lot out of the custom theme tutorial, btw. It was a huge help to me.
Zac Gordon
Treehouse Guest TeacherOh, glad to hear that! That parameter should give you what you're looking for ;)
Ben Goldman
14,626 PointsBen Goldman
14,626 PointsProblem solved.
As it turns out, there is not a regular option for this feature in the WP admin area. Which is what I had figured already. For anyone else having this same problem, however, I highly recommend the Post Types Order plugin.
https://wordpress.org/plugins/post-types-order/
It allows you to simply drag and drop your post items into any desired order. Unfortunately, anytime you add a new item, you'll have to adjust the order manually. But, it's simple and fast, so not such a big deal really.