• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Show Different Front Page Template For Logged In Users

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:

  1. One is the new template you need to create which is named members_home.php
  2. 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:

Register for full access

Other Options

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?

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems