Title: Category select
Last modified: August 20, 2016

---

# Category select

 *  Resolved [Rosti](https://wordpress.org/support/users/rosti/)
 * (@rosti)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/category-select/)
 * Hi,
 * When somebody send me a post, the post automatically take to the original wordpress
   appointed post category. I want that, the guest’s post AUTOMATICALLY take a different
   category basically. When and how I can to set this in guest-posts-submit.php??
   Sorry, but I’m an amateur. :o)))
 * Thank you!
 * [http://wordpress.org/extend/plugins/guest-posts/](http://wordpress.org/extend/plugins/guest-posts/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Babar](https://wordpress.org/support/users/ibabar/)
 * (@ibabar)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/category-select/#post-3421110)
 * You can try to edit the submit file.
 * There’s a array with those informations.
 *  Thread Starter [Rosti](https://wordpress.org/support/users/rosti/)
 * (@rosti)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/category-select/#post-3421114)
 * Hi,
 * yes, I can edit, but don’t know the correct strings. Please write mee!! (I know
   the required category’s slug, and ID, but don’t know, how must insert to the 
   code)
 * Thank you for the quick answer!
 *  Plugin Author [Babar](https://wordpress.org/support/users/ibabar/)
 * (@ibabar)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/category-select/#post-3421116)
 * I’m also not clear about it, that’s why haven’t documented about that.
 *  Thread Starter [Rosti](https://wordpress.org/support/users/rosti/)
 * (@rosti)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/category-select/#post-3421118)
 * ‘post_category’ => $category, // Usable for custom taxonomies too
 * Only this is the all info. It’ not enough me! :o)))
 * If the category ID=124, how must to insert ?
 * Sorry, I’m an really amateur. .o))))
 *  Plugin Author [Babar](https://wordpress.org/support/users/ibabar/)
 * (@ibabar)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/category-select/#post-3421120)
 * I’m also not clear about it, that’s why haven’t documented about that.
 *  [Nate_Nevins](https://wordpress.org/support/users/nate_nevins/)
 * (@nate_nevins)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/category-select/#post-3421435)
 * babar, for line:
    ‘post_category’ => $category, // Usable for custom taxonomies
   too
 * your problem is that it is asking for a array not a string. so for a quick fix
   all you would need to do is:
    ‘post_category’ => **array(**$category**)**, and
   wala its fixed 🙂
 * //helper cat is helping
 *  [Nate_Nevins](https://wordpress.org/support/users/nate_nevins/)
 * (@nate_nevins)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/category-select/#post-3421436)
 * Rosti, So all you need to do is apply the fix i give earlier and express the 
   category you want on the shortcode like [guest-posts category=’124′] and that
   should fix your problem right quick and in a hurry
 *  Plugin Author [Babar](https://wordpress.org/support/users/ibabar/)
 * (@ibabar)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/category-select/#post-3421437)
 * Thanks Nate.
    I will update the plugin ASAP. 🙂
 *  [TedSwiss](https://wordpress.org/support/users/tedswiss/)
 * (@tedswiss)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/category-select/#post-3421440)
 * Hello,
 * Thanks for this nice plugin but even following clearly your indication it’s not
   working with following call:
 * [guest-posts category=’14985′ author=’5′]
 * Would be happy to find the trick, thanks for your help!
 *     ```
       This is a part of Guest Posts Plugin for WordPress.
       */
   
       //Get the submitted form
       ob_start();
       require_once($_POST["rootpath"]);
       $title = $_POST["title"];
       $longtitle = $_POST["longtitle"];
       $story = $_POST["story"];
       $resume = $_POST["resume"];
       $image_100100 = $_POST["image_100-100"];
       $image_490270 = $_POST["image_490-270"];
       $tags = $_POST["tags"];
       $authorbio = $_POST["authorbio"];
       $auteurimage = $_POST["auteurimage"];
       $youtubelink = $_POST["youtubelink"];
       $email = $_POST["email"];
       $deezeralbum = $_POST["deezeralbum"];
       $authorid = $_POST["authorid"];
       $artiste_nc = $_POST["artiste_nc"];
       $category = $_POST["category"];
       $thankyou = $_POST["thanks"];
       $path = $_POST["rootpath"];
       $nonce=$_POST["_wpnonce"];
   
       //Load WordPress
       //require($path);
   
       //Verify the form fields
       if (! wp_verify_nonce($nonce) ) die('Security check'); 
   
          //Post Properties
           $new_post = array(
                   'post_title'    => $title,
                   'post_content'  => $story,
                  'post_category' => $category,   // Usable for custom taxonomies too
                   'tags_input'    => $tags,
                   'post_status'   => 'pending',           // Choose: publish, preview, future, draft, etc.
                   'post_type' => 'post',  //'post',page' or use a custom post type if you want to
                   'post_author' => $author, //Author ID
           );
           //save the new post
           $pid = wp_insert_post($new_post);
   
           /* Insert Form data into Custom Fields */
           add_post_meta($pid, 'auteur_n1', $auteur_n1, true);
           add_post_meta($pid, 'author-email', $email, true);
           add_post_meta($pid, 'author-website', $site, true);
       	add_post_meta($pid, 'artiste_nc', $artiste_nc, true);
       	add_post_meta($pid, 'resume', $resume, true);
       	add_post_meta($pid, 'longtitle', $longtitle, true);
       	add_post_meta($pid, 'image_100-100', $image_100100, true);
       	add_post_meta($pid, 'image_490-270', $image_490270, true);
       	add_post_meta($pid, 'youtubelink', $youtubelink, true);
       	add_post_meta($pid, 'authorbio', $authorbio, true);
       	add_post_meta($pid, 'auteurimage', $auteurimage, true);
       	add_post_meta($pid, 'deezeralbum', $deezeralbum, true);
   
       header("Location: $thankyou");
       ?>
       ```
   
 *  [Jay Syder](https://wordpress.org/support/users/jay-s/)
 * (@jay-s)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/category-select/#post-3421441)
 * Hi Ted swiss if you change the line
    ‘post_category’ => $category, // Usable 
   for custom taxonomies too to ‘post_category’ => array($category), // Usable for
   custom taxonomies too
 * as Nate_Nevins said then on guest-posts/guest-posts.php
 * make sure the line
    ‘cat’ => ‘1’, to ‘cat’ => ”,
 * after this you can use the short code [guest-posts cat=’14985′ author=’5′]

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Category select’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/guest-posts.svg)
 * [Guest Posts](https://wordpress.org/plugins/guest-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/guest-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/guest-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/guest-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/guest-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/guest-posts/reviews/)

 * 10 replies
 * 5 participants
 * Last reply from: [Jay Syder](https://wordpress.org/support/users/jay-s/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/category-select/#post-3421441)
 * Status: resolved