Hey Guys,
Working on a new project – its abit like a classified ads, I want a user to come onto the site and post something they have for sale, but I dont want them to have a login, just be able to post there listing with thier contact details.
Can this be done?
Cheers
- Referred more than 2000 users
- Power Elite Author: Sold between 2 000 000 - 4 999 999 dollars
- Author was Featured
- Item was Featured
- Austria
- Bought between 100 and 499 items
- Has been a member for 4-5 years
- Interviewed on the Envato Notes blog
Yes, thats possible.
just use the
<?php wp_insert_post( $post ); ?>
function described here: http://codex.wordpress.org/Function_Reference/wp_insert_post
All you need to do is to build a form anywere in your front-end that the user can access and then upon submitting build the new post out of the data the user submitted…
a simple way is to use the comment form to do that.
http://justtweetit.com/ is an example.
Thanks guys 
Cant wait for Wordpress 3 with the custom post types!
For now I think i am going to do a form and let it create the post – until wordpress 3 comes out.
Cheers for the info 
If advanced coding (what Kriesi suggested) sounds hard for you, then you could also use TDO Miniforms for this 
If advanced coding (what Kriesi suggested) sounds hard for you, then you could also use TDO Miniforms for this![]()
Hey good find
This might be prefect to get my site up quicker – only have a 3 week turn around – Like I said before I am wanting to fully develop my project using WP3 and use the Custom Post Type – it real looks awsome – http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0/?allcomments
Thanks again for the link
- United States
- Sold between 250 000 and 1 000 000 dollars
- Featured in a Magazine
- Won a Competition
- Was featured in a podcast
- Author was Featured
- Item was Featured
- Beta Tester
OMG , how in the world have I NOT heard of “wp insert post”!!!
Thanks Kriesi!
its very simple. Same as what Kriesi said. just make a simple form that will feed into the array. here is a very basic example with a simple form that has no validation.
Edit: I dont know why does it add the SYSTEM word into my doctype. 
<?php $postTitle = $_POST['post_title'];
$post = $_POST['post'];
$submit = $_POST['submit'];
if(isset($submit)){
global $user_ID;
$new_post = array(
'post_title' ?> $postTitle,
'post_content' => $post,
'post_status' => 'publish',
'post_date' => date('Y-m-d H:i:s'),
'post_author' => $user_ID,
'post_type' => 'post',
'post_category' => array(0)
);
wp_insert_post($new_post);
}
?>
<!DOCTYPE HTML SYSTEM>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled Document</title>
</head>
<body>
<div id="wrap">
<form action="" method="post">
<table border="1" width="200">
<tr>
<td><label for="post_title">Post Title</label></td>
<td><input name="post_title" type="text" /></td>
</tr>
<tr>
<td><label for="post">Post</label></td>
<td><input name="post" type="text" /></td>
</tr>
</table>
<input name="submit" type="submit" value="submit" />
</form>
</div>
</body>
</html>
Hello,
how needs the upper code to be modified in order to put more than one field into “post_content”. With some sort of array I think, but I don’t know how to do that. Can someone help me please, thanks
