V
V
Vladimir2018-09-30 09:22:26
WordPress
Vladimir, 2018-09-30 09:22:26

How to make a separate main page displayed for a separate category of a site user?

The site has different categories of users. Subscriber, author, guest, etc. What plugin can make it so that each user category displays its own main page and other elements?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
id_baton4eg, 2018-09-30
@id_baton4eg

I think none, but VP has a hook that allows you to change the address of the template_include page
https://wp-kama.ru/id_5177/3-sposoba-sozdat-shablo...

add_filter('template_include', 'my_template');
function my_template( $template ) {
  if( is_page('portfolio') && current_user_can('member') ){
    if ( $new_template = locate_template( array( 'page-portfolio.php' ) ) )
      return $new_template ;
  }
  return $template;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question