I have two custom post types called 'project' and 'project-won'. If a user goes to a single 'project' that is in draft status, I want them to be redirected to the corresponding 'project-won' post.
Each post will be replicated across both post types, so if there was a 'project' that had the following URL:
mydomain.com/?project=test-project/ , then ther would be a 'project-won' with the URL:
mydomain.com/?project-won=test-project/.
Can I just put something at the top of the 'single-project.php' template page such as
<?php if($post->post_status == "draft"){
//add the redirect here
I don't know what the best way to do this would be?