Here is my case, I'm making some experiments with post types, basically I created a post type called Slider where the featured image is will display in the slide.
Now, when user type something like domain.com/slider/slide1, or try to reach the slider post, I want to display a not found page instead of the single page, or the index in case I dont have the post single page.
Is it possible to achieve?
Solved!
Thanks to Saif Bechan, I could solve my problem,
Basically I used this function
add_action('template_redirect', 'my_template_redirect');
function my_template_redirect() {
global $wp_query, $post;
if(is_singular('Slider'))
{
$wp_query->set_404();
}
}
Where Slider is the Post Type name,