I'm attempting to create a Twitter style stream, so basically just index, a tag archive, and maybe a page or two while prohibiting access to everything else. For instance, they try to access a single post page and are tossed back to home. Is this appropriate use of redirects and wp_redirect, and if so, would it be better to create a dummy file (single.php for instance) that only contains wp_redirect or just use conditionals at the top of my header.php? Or am I totally off course?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
It seems this would just be a function of your theme. If you don't provide links to single posts, categories, etc., then as far as your visitors are concerned, those things effectively don't exist. If you really want to prevent access to things, you can't redirect in a template as headers have already been sent. You could maybe add an action to Here's a simple example:
|
|||
|
|
|
wp_redirect() does not exit automatically and should almost always be followed by exit. |
|||
|
|
