How can I correctly redirect user to the submitted post and define a template for each new post in WordPress?

you need to get the ID from wp_insert_post and make sure you exit or die so: $pid = wp_insert_post($new_post); wp_redirect( get_permalink( $pid ); die(); As for the second part you can use the WordPress Template Hierarchy and simply name each one of your custom post type designs as single-{post_type}.php for example if your post type … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)