Tag Info

Hot answers tagged


I believe that you can achieve this effect by grouping the query by author ID, which will require a filter(mostly cribbed from the Codex): function my_posts_groupby($groupby) { global $wpdb; $groupby = "{$wpdb->posts}.post_author"; return $groupby; } add_filter( 'posts_groupby', 'my_posts_groupby' ); If you have less than 8 authors, ...


You aren't constructing the meta_query correctly. It is close but not quite right. $searchArray = array(); $searchArray = array('relation' => 'OR',); // here is the change // loop over checked checkboxes if(!empty($_POST['course_location'])) { foreach($_POST['course_location'] as $check) { // echo '<h1>'.$check.'</h1>'; ...


$term_id = get_terms('category'); is unnecessary, the current category object is held within $film_category. $film_category->term_id will give you the ID of the category you are currently fetching posts from.


wp_generate_metatadata() should create metadata for image, video, and audio file types. There is and if/elseif conditional in the source that limits the function to those three. However, the last line is: return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id ); So you could use the wp_generate_attachment_metadata filter to ...


This will get you the choices array inside $field variable: $choices = $field[ 'choices' ]; From there, you can iterate with either a while or foreach loop depending on what you are trying to do with the array. EDIT: rereading your question, you specify what you are trying to do! Sorry for skipping that part! echo '<ul>'; foreach($choices as $key ...


You cannot define something outside a function and then simply try to use it inside the function without calling it into the function. This is basic PHP and how functions work in general. You need to pass that specific something to the function or define that something inside the function or use a method to globalize that something and then invoking it ...


I found a solution. I have to use ['post__in'] $resume_args = array(); $resume_args['post_type'] = 'resume'; $resume_args['posts_per_page'] = -1; $resume_args['post__in'] = array(9046, 9346); //works! $resume_args['s'] = 'gassi gehen'; $resumes = new WP_Query($resume_args);

Only top voted, non community-wiki answers of a minimum length are eligible