This tutorial includes all the code which displays a different template on the front page for logged in users only.
Logged out visitors will see the default template.
One of the reasons you might want to use this solution is if you have a landing page and don’t want to show that page for members who have already joined.
There’s 2 files you need to deal with:
- One is the new template you need to create which is named members_home.php
- And the other is the code for your child themes functions file.
Logged In Template
Simply create a new file using a code editor like Notepad++ and add your code to the file like this:
You could code functionality for both templates into the same file and use the is_user_logged_in() conditional tag to execute specific functions for logged in and out users but i think using 2 templates is a cleaner solution.
What do you think?