Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

[Support request] Static Pages as Author Archives

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Static Pages as Author Archives

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21746
    Rolandas
    Participant

    Hi

    I use this snippet for static pages as Author Archives.

    add_filter('request', function( array $query_vars ) {
    //    if ( is_admin() ) {
      //      return $query_vars;
     //   }
    
        if ( isset( $query_vars['author_name'] ) ) {
            $pagename = $query_vars['author_name'];
    
            $query_vars = array( 'pagename' => "$pagename" );
        }
    
        return $query_vars;
    } );

    It worked great for me, but not when there is one user, he is both an administrator and a post author.
    (I deleted my other users: I had created several with different e-mails, and changed the authors of the posts)
    My posts and WPSP posts lists author links returns https://www.sisla.lt/author/admin/
    but not https://www.sisla.lt/rolandas-sisla/ author page link.
    (I use GP PRO and WP Show Posts Pro, both latest versions)

    Maybe you can advise what to do?

    #21824
    Tom
    Keymaster

    Hi there,

    I’m afraid I’m not overly familiar with the internal workings of WordPress in this filter, unfortunately.

    Technically, that filter is looking for the author name in the request and if it exists, it looks for a page with the same name and transfers the request to that page.

    I’ve never played with it for authors, but it’s possible that is simply isn’t compatible with author archives.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.