Now i create a wordpress front-end post, after wp_insert_post(); i want to redirect into the full page of that post data. Here i use the this way, so it was redirect the blog index page, but i need this page redirect this post full page.
$post_insert = array(
'post_title' => $title,
'post_content' => $content,
'tags_input' => $post_tags,
'post_status' => 'publish',
);
$post_id = wp_insert_post( $post_insert );
wp_redirect( site_url()."?post=$post_id" );
exit();
I think the issue is with $post_id being inside the double quotes. Try this instead:
It is better to use this:
The get_permalink method is the Wordpress built-in method to get a permanent link. See this url for the documentation for this method: http://codex.wordpress.org/Function_Reference/get_permalink