I've looked at a couple of plugins, but none that ticks the boxes. Plus... I would ideally do this myself in the code (to ensure safety). I'm making a site, that should work as an intern CRM-system, built in WordPress. I have a custom-made parent-theme, so I'm making a child-theme, that should put all content behind the login-wall (menu, footer, sidebar, all post types, you name it).
I considered just going through all the code and putting this around everything:
if ( is_user_logged_in() ) {
<nav class="header-nav">
<?php
wp_nav_menu(
array(
'theme_location' => 'header-menu',
'fallback_cb' => false,
'container_class' => 'menu-header-menu-container',
)
);
?>
</nav>
}
But it seems like quite a hassle. Besides, then if someone 'guesses' a URL to an image, then they'd still be able to see that.
Am I missing some obvious/better way of doing this?