trying to write a variable into a wp_query, need help!
Using get_posts(): <?php $category = get_category_by_slug($post->post_name); $template = $category->term_id; $taskarr = array( ‘post_type’ => ‘listing’, ‘post_status’ => ‘publish’, ‘category’ => $template, ‘order’ => ‘ASC’, ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘listing_date’ ); $tasks = get_posts($taskarr); foreach( $tasks as $task ) { echo ‘<li>’; echo $task->post_title; echo $task->post_excerpt; echo get_post_meta( $task->ID, ‘location’, ‘single’); echo ‘<li>’; } ?> … Read more