cwulff

Untitled

May 27th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. /**
  2.  * Testing a thing for Beth.
  3.  *
  4.  */
  5.  
  6. // First let's check to make sure this function has not been run before
  7. if (get_option('changeposttype_has_run') != "yes") {
  8.        
  9.     //Get all the posts in category 230 - change that number to the category ID of posts you're trying to change
  10.     query_posts("post_type=post&cat=230&showposts=-1&offset=0");
  11.     if (have_posts()) : while (have_posts()) : the_post();
  12.         set_post_type($post->ID, 'uu_services');
  13.         endwhile; endif;
  14.    
  15.     wp_reset_query();
  16.  
  17. //now that function has been run, set option so it wont run again
  18. update_option( 'changeposttype_has_run', 'yes' );
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment