0

I've built a website for a client who now needs a protected area for multiple clients to access the same library of documents. However, she wants the header to display any given user's company logo so it looks branded to specifically to them.

All the users are going to have the same access to the same files.

My first thought was to create a single page and use a header that displays logos linked to specific users (or maybe key passwords).

Then I thought about making multiple copies of the same page (with different headers), but then I have to figure out how to redirect them to the right page on login.

What's the best solution? Is there an easy way to do this or do I need to create some serious PHP?

I'm working with WP-Members at the moment, but haven't committed to it as I'm not convinced it's 100% the right fit.

I really appreciate your advice.

3 Answers 3

1

If WP Members (or another plugin like User Access Manager) provides conditional tags for specifying the current user's "group" then you could use that to switch out the logo. One of those might also give you a way to insert a class into the <body> tag that you could use to switch out the logo via CSS.

OR, if you just have one user per company, you could add the current user's username to the body_class() and use that.

0

I would create a custom post type ( https://developer.wordpress.org/plugins/post-types/ ) called client-logo.

I'd make it support only image types.

I'd create a field to select from registered clients.

Then, in the page template create a logo area where I'd query the client-logo CPT for the registered user then display it or display a fallback.

0

Here's the code I used to redirect a non-logged in user back to my main site when the user clicks the header logo. If the user is logged in and clicks the logo then the user is taken back to the home page of the site the user is currently on. This would go in the header.php.

<?php if ( is_user_logged_in() ) { ?>
     <a href="<?php echo home_url(); ?>">
        <?php fre_logo( 'site_logo' ) ?>
     </a>

<?php } else { ?>
     <a href="https://yoururl.com">
            <?php fre_logo( 'site_logo' ) ?>
     </a>
<?php } ?>

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.