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

1 Answer 1

3

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 and acknowledge you have read our privacy policy.

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