The WordPress reading settings can be found under Settings > Reading.
I have the WordPress ‘Front page displays’ option set to ‘Static front page’.
My ‘Front page’ is set to ‘About’.
I am trying to have a different front page for logged out and logged in users. Currently everyone views the ‘About’ page when they visit example.com.
- If I visit example.com when logged out I want to see my ‘about page’
- If I visit example.com when logged in I want to see my ‘contact page’
Does anybody know how I can achieve this?
It’s possible to set the
front page
programmatically but not sure if this is a solution to your question, so, paste this code in yourfunctions.php
file and give it a tryP/S: Not tested, just try it and please response what you get.
For anyone else that has this problem you could just add this to the
header.php
, at the very top before the<!DOCTYPE html>
:OR you can add this to Functions:
In the body of your page-about.php (or which ever template file the About page is using) you just need to use a conditional statement.
You could add this to your functions.php
It’s not a great solution to hard code in your url, but you could pick up the URL in other ways.
UserPro plugin gets this done easily. Just enter the URL you want logged in users to see instead of the normal homepage. So Simple!