Hi George,
Thank you for asking. It is a very good question.yes, It is easily doable.
here is the code that you can use to display a different page on home page for logged in user
/** * When a user is logged in, tell WordPress to use 'page' on front page of the site * @param string $value * * @return string */ function buddydev_set_page_as_front_for_loggedin_user( $value ) { if ( is_user_logged_in() ) { $value = 'page';//page is set as front page } return $value; } add_filter( 'pre_option_show_on_front', 'buddydev_set_page_as_front_for_loggedin_user' ); /** * For logged in users, set our static page to act as home page * * @param $value * * @return int */ function buddydev_set_context_based_page_on_front( $value ) { if( ! is_user_logged_in() ) { return $value; } //for logged in user, use page id 9 return 5;//change with your own page id. } add_filter( 'pre_option_page_on_front', 'buddydev_set_context_based_page_on_front' );
You can change the page_id with your own id.
Hope that helps.
Regards
Brajesh
Viewing 5 posts - 1 through 5 (of 5 total)
The topic ‘ [Resolved] Different home page for logged in users’ is closed to new replies.
This topic is: resolved