fr33think3r
Member
Posted 1 year ago #
I have ported p2 theme to be used as a page template with a custom post type. The results can be seen here.
http://www.humbug.in/mblog/
The code is hosted here:
http://code.google.com/p/p2-theme-page-template/
A lot of things are specific to my blog, and whosoever uses it will have to change it to their liking and blog schema.
joehuffman2
Member
Posted 1 year ago #
You didn't have to change the js to achieve adding post types? How does the AJAX get called? I am impressed, few people have tried to wander changing around P2.
Bravo!
fr33think3r
Member
Posted 1 year ago #
I did have to change a bit of js, and some changes in ajax.php, but nothing major. Ajax gets called the same way as it is in the p2 theme. I just make sure the correct post_type gets used in wp_insert_post.
$post_id = wp_insert_post( array(
'post_author' => $user_id,
'post_title' => $post_title,
'post_content' => $post_content,
'post_type' => $p2_custom_post_type,
'post_category' => array( $post_cat->cat_ID ),
'tags_input' => $tags,
'post_status' => 'publish'
) );