1

I have a multisite installation with 2 subsites (site A, site B) using same theme. Is it possible to use a different author.php if Im on the site B? Assuming the second author template exists.

For exeample..

if (blog_id == 2){
// use this template
diff-author-template.php
}
else {
//use this
author.php}

Thanks

2

This was the solution..

// different author template */
add_filter( 'template_include', 'author_template', 99 );

function author_template( $template ) {
    if( !is_main_site() and is_author( ) ) {
        $new_template = locate_template( array( 'other-author.php' ) );
        if ( '' != $new_template ) {
            return $new_template ;
        }
    }
    return $template;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.