Redirect in WordPress

Using WordPress.. I would like to redirect to a certain page on the site if the user visits an archive is_archive()

How would I go about this please? Could I add something to functions.php?

Read More

Cheers,
Steve

Related posts

Leave a Reply

5 comments

  1. Using WordPress hook in functions.php, just paste this snippet in your functions.php

    function redirect_to_url(){
        if(is_archive()){
            $url='your redirect url url';
            wp_redirect( $url );
        }  
    
    }
    add_action('template_redirect', 'redirect_to_url');
    

    There is an article here, it may help you.

  2. in your archive.php template file put an if statement at the top with header location redirect if the criteria for redirection is met, perhaps using is_page(); by the sounds of it

    or if it is a certain page you could do something in .htaccess