Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

ionurboz on "WordPress custom post_type"

$
0
0

Hi,

I'll using 'sound','video','article','image' custom types.

And I did a special new post function without admin panel. I am need, a post in the more type.

I'm tested it but array error:

/*find type*/
$post_type=array('article');

		if(isset($post_img))
			array_push($post_type, "image");
		if(isset($post_vid))
			array_push($post_type, "video");
		if(isset($post_sou))
			array_push($post_type, "sound");

............

/*select type*/
$arrays = array(
	  'post_type'	  => $post_type,

...........

$id = wp_insert_post( $arrays, $wp_error );
/*add post*/

Simple:

localhost/?video=hello and this in localhost/article=hello

Any one help me.. Sorry for bad english :)


Viewing all articles
Browse latest Browse all 8245

Trending Articles