• Thanks for your plugin. I use it on several sites.
    I wanted to ask if another small but very useful feature could be set up for me, that blank archive pages (authors, taxonomies) could be set up in the same behavior as 404 page behavior – that visitors would not be allowed to view it, but that pages would refer to a similar post or taxonomy.
    I have a code that redirects almost empty archive pages (i.e. archive pages that have only one post) to the post that appears in the archive, but I have not yet found a solution for archive pages when they are completely empty.
    I’m waiting to hear what you have to say, and whether you are interested in doing so.

Viewing 1 replies (of 1 total)
  • Thread Starter moshe

    (@moshe1111)

    function redirect_to_post(){
        global $wp_query;
        if( is_archive() && $wp_query->post_count == 1 ){
            the_post();
            $post_url = get_permalink();
            wp_redirect( $post_url );
        }   
      
    } add_action('template_redirect', 'redirect_to_post');
Viewing 1 replies (of 1 total)
  • The topic ‘Feature Request Blank archive pages’ is closed to new replies.