Skip to content

Instantly share code, notes, and snippets.

@AlphaAlec
Last active May 30, 2018 16:25
Show Gist options
  • Save AlphaAlec/edddd769a07e8316a1e7dc8a47143e2e to your computer and use it in GitHub Desktop.
Save AlphaAlec/edddd769a07e8316a1e7dc8a47143e2e to your computer and use it in GitHub Desktop.
<?php
$args = array(
'post_type' => 'post',
'category_name' => array(7),
'nopaging' => true,
'suppress_filters' => true,
'fields' => 'ids'
);
$posts = new WP_Query($args);
echo '<h1>'. $posts->found_posts .'</h1>';
while( $posts->have_posts() ) {
$posts->the_post();
set_post_type( get_the_ID(), 'recipes' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment