Query to change custom post type with specific category

I would do it in php in two parts rather than one big raw sql statement, for safety reasons, eg in your “functions.php” put: function wpse160706() { $old_post_type=”films”; $new_post_type=”post”; $category_slug = ‘directors’; $taxonomy = ‘category’; global $wpdb; $sql = $wpdb->prepare( ‘SELECT p.ID FROM ‘ . $wpdb->posts . ‘ AS p’ . ‘ JOIN ‘ . … Read more

Displaying different custom post types under one admin menu

step 1: paste below code in your function.php (change the post_type) function house_a() { $args = array( ‘post_type’ => ‘house_a’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { $returnvariable = “”; while ($my_query->have_posts()) : $my_query->the_post(); $returnvariabla .= get_the_content(); endwhile; return $returnvariable; } wp_reset_query(); … Read more