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 trialJoseph Fernandez
631 Pointsi noticed that we did not use the 'include on home page' tag that was initially set up
Hi Zac, i noticed that we did not use the 'include on home page' tag that was initially set up.
After doing some playing around this is what works on my end, not sure if this is to filter the array to include only items which have been selected to be displayed.
FYI: i've called my selection box featured.
For now this seams to work.
$args = array( 'post_type'=>'work', 'posts_per_page'=>4, 'orderby'=>'rand', 'post__not_in' => array(get_the_id()), 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'featured', 'value' => '', // 'compare' => '!=' // only seams to work with not =, does not work with value ) ) );