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
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?
Your best option is to use a taxonomy. If EN, DE and FR are terms then you then loop through them and get the pages on a per term basis. You can do this in conjunction with a plugin that enables you to manually re-order terms such as this one. https://wordpress.org/plugins/i-order-terms/ You can then do … Read more
which gives me all posts inside the tax inspiration – I need to alter this, so that I get only selected ID’s in my array, ex. 4714, 3608, instead of all terms of the tax. I’m assuming you mean that this query gives you all posts inside post type inspiration and you want to pull … Read more