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?
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!
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.
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.
Try this plugin recently released to solve the problem head on https://wordpress.org/plugins/dual-homepage/. It’s solves the problem by allowing you the user to select a homepage for logged out users and another for logged in users.
What may also help is that with the newly updated Wordpress admin post interface using blocks you can set some for logged in users to see and set others for logged out users to see. I use a combination of this plugin and the new Wordpress blocks to achieve what I wanted with my site. To get started you need to download “Block Options” first which you can get it on the plugin directory.
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: