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

Jake Bolton
Jake Bolton
1,956 Points

Advanced post query array

Hi,

I'm trying to find a tutorial that could help me to implement a post query in Wordpress theme.

I need to be able to query a list of posts by location. In this case by UK postcode.

Could really use some help.

Many thanks, Jake

2 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Here's how to use WP_Query for querying by custom post type values, which I assume the zip code would be.

http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

Jake Bolton
Jake Bolton
1,956 Points

Nice one! Cheers Zac.

This definitely looks like what I've been looking for.

These look like nested arrays, I hadn't thought about that.

Thanks again, Jake