Search CPT by tag ids

I have done by my self. Here is the solution $args = array( ‘post_type’ => ‘gampu’, ‘posts_per_page’ => -1, ‘post_status’ => ‘any’, ‘orderby’ => ‘ID’, ‘order’ => ‘DESC’, ‘tax_query’ => array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘my-tag-taxonomy1’, ‘field’ => ‘id’, ‘terms’ => array(30,31,34), ), array( ‘taxonomy’ => ‘my-tag-taxonomy2’, ‘field’ => ‘id’, ‘terms’ => array(30,31,34), … Read more

How to draft posts after being published with x days

I would suggest you use wp_schedule_event() and create a custom hook that you trigger daily. This hook can then call a custom function in which you query posts with the desired publish date, and change their status. For example, create a new plugin and add (note: I have not tested this): // Schedule auto-drafting post … Read more

WordPress sorting posts by date and title using a dropdown

Here I put orderby attributes as option values – date and title. <form method=”GET”> <select name=”orderby” id=”orderby”> <option value=”date”>Newest to Oldest</option> <option value=”title”>Alphabetical</option> <button type=”submit”>Apply</button> <form> On the same page you can recieve select value and set as orderby attribute $wpb_all_query = new WP_Query(array( ‘post_type’=>’post’, ‘posts_per_page’=>-1, ‘order’=>’ASC’, ‘orderby’=> esc_attr($_GET[‘orderby’]) ); Use your loop to show … Read more