Why is WP_Query’s meta_query not filtering results?
Why is WP_Query’s meta_query not filtering results?
Why is WP_Query’s meta_query not filtering results?
Meta_query weird behaviour
i think that you need to use wp_reset_query(); before woo_loop_after();
the change you require is a modification to your theme, it will take time and you might end up corrupting it if you are not comfortable working with WordPress, instead of that you can make a child theme for it and make whatever change you want inside it. A replacement and partial solution would be … Read more
Your query would be something like: $post_ids = $wpdb->get_col( “SELECT DISTINCT post_id FROM {$wpdb->prefix}wti_like_post WHERE user_id = {$author->ID}” ); Then you can pass that array of post IDs as the post__in argument of WP_Query: $args = array( ‘posts_per_page’ => -1, ‘post__in’ => $post_ids );
Both get_posts() and wp_query() should be able to do this by passing the tax_query array into them. Example: $query = array( ‘post_type’ => ‘portfolio’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘clients’, ‘field’ => ‘slug’, ‘terms’ => array( ‘acme’ ) ) ), ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’ ); $posts … Read more
Posts are not sorted alphabetically, because you don’t tell WordPress to sort them in such way. By default they will be sorted by date in descendant order (newest first). What you should do, is change your WP_Query args by adding order and orderby, so it should look like this: $args = array( ‘post_type’ => ‘os_book’, … Read more
Pop up showing same content on all posts display.
If I’m understanding this correctly something along these lines should work. $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 ) ) { $query = array( ‘posts_per_page’ = -1, ‘author__in’ = … Read more
You could achieve this with a filter on category_template. This would go in your theme’s functions.php file. See the comments in the code for an explanation of what it’s doing: function video_category_archive( $template=”” ){ // your parent video category ID // ( change this to your actual video category ID ) $video_cat_id = 42; // … Read more