Inline Ajax call after term is appended with a @ or # etc. displayed in div
Inline Ajax call after term is appended with a @ or # etc. displayed in div
Meta query must be done with a nested array. So it may look more like this: $query = new WP_Query( array( ‘meta_query’ => array( array( ‘key’ => ‘duedate’, ‘value’=> $today, ‘compare’ => ‘>=’, ), ), ‘paged’ => $paged, ‘posts_per_page’=>’20’ ) );
If I’m understanding you correctly you just need two more arguments in your $args array. Firstly, category_name – see WP_Query – Category Parameter. We get the value from the $wp_query global via get_query_var(), so like this: ‘category_name’ => get_query_var( ‘category_name’ ) Secondly, for the number of posts to show there is posts_per_page as it is … Read more
Inline Ajax call after term is appended with a @ or # etc. displayed in div
WP Query to order posts by multiple meta fields
Show sticky post before other WP_Query
Just add this before your code $authors = array( 1, 2, 3 ); // privileged users array $signed_in_user = wp_get_current_user(); // get current user // check if singed in user is in authors array if ( in_array( $signed_in_user->ID, $authors ) ) : And then this after your code <?php else : ?> This message will … Read more
Orderby Meta Value and Query from Meta Query
If I got it well, something like snippet below should would do what you want. I assume there are four items in your ‘gallery-area’ taxonomy and that the class you apply to your div has to vary accordingly (i.e. span_1_of_4 has to become span_2_of_4, etc.). <?php $gt_args = array(‘fields’ => ‘ids’); $terms = get_terms(‘gallery-area’, $gt_args); … Read more
Use the meta_query argument of WP_Query. For example, if your custom field name is “year” and you want to get the post with year=2013: <?php $loop = new WP_Query( array( ‘post_type’ => ‘Sport’, ‘posts_per_page’ => 3, ‘meta_query’ => array( ‘meta_key’ => ‘year_comm’, ‘meta_value’ => ‘2013’, //Assuming you are using numeric value //if not, delete the … Read more
More efficient query to display posts in same sub-category?