Select menu should display categories and the item’s depth
Select menu should display categories and the item’s depth
Select menu should display categories and the item’s depth
Show all parents and children in custom post type in right order
It is quite hard to properly answer your question with the amount of context in your question, but I am going to try to use the context from your previous question Having a bit more context here on template, and if I read this correctly, this is on your index.php, I still believe and stand … Read more
You need to set ignore_sticky_posts to true in your query arguments. This way you exclude sticky posts and only focus on the post ID’s array being passed to post_in ‘ignore_sticky_posts’ => true, EDIT If this does not make much sense, please see my answer here to similar question where I have explained it a bit … Read more
I think we can try the following: (NOTE: This is untested but should in theory work, but remember, it is untested and can be buggy) add_action(‘pre_get_posts’, ‘ad_custom_query’); function ad_custom_query($query) { // No other checks should be necessary if ( $query->get( ‘custom_query’ ) === 1 ) ) { // set the number of posts per page … Read more
To get the attached term IDs, use get_the_terms() and wp_list_pluck(): if ( $terms = get_the_terms( $post, ‘director’ ) ) { $term_ids = wp_list_pluck( $terms, ‘term_id’ ); }
There’s some contradiction between your question and the code you provided, so I’m not exactly sure which of two scenarios you’re dealing with. Scenario 1 – You want to show all Shops with a specific value for shop-id and all Restaurants with the same specific value for restaurant-id. Let’s say that value is 20. You … Read more
You can use the date_query part of WP_Query. Here’s an example: $args = array ( ‘post_type’ => array( ‘post’ ), ‘post_status’ => array( ‘publish’ ), ‘category_name’ => ‘airing’, //<– N.B. This is for a category slug! ‘date_query’ => array( array( ‘column’ => ‘post_modified_gmt’, ‘after’ => ‘today’, ‘inclusive’ => true ), ) ); $query = new … Read more
If you want both posts that have and do not have a meta key, you need an OR relation meta query to select both posts with key and those where it does not exist. $args = array( ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘_post_like_count’, ‘compare’ => ‘EXISTS’ ), array( ‘key’ => ‘_post_like_count’, … Read more
This Plugin gives you a list of posts for each Site already, but it does not exactly do what you want to do. Basically, it gives you a list of all posts in your network. What you need to do afterwards is sort them by site_id and create an output for that. I do not … Read more