Custom Page for Logged In User
-
Hi,
I tried to make a custom page for my homepage base on logged in and logged out user. I’d like to have full page without sidebar when user logged out and with sidebars when user logged in.
I use this code but not working, the sidebar space still there:
<?php /* Template Name: Home Page */ ?> <?php get_header(); ?> <?php if ( is_user_logged_in() ) { ?> <section class="content"> <?php get_template_part('inc/page-title'); ?> <div class="pad group"> <?php while ( have_posts() ): the_post(); ?> <article <?php post_class('group'); ?>> <?php get_template_part('inc/page-image'); ?> <div class="entry themeform"> <?php the_content(); ?> <div class="clear"></div> </div><!--/.entry--> </article> <?php if ( ot_get_option('page-comments') == 'on' ) { comments_template('/comments.php',true); } ?> <?php endwhile; ?> </div><!--/.pad--> </section><!--/.content--> <?php get_sidebar(); ?> <?php } else { ?> <section class="content"> <?php get_template_part('inc/page-title'); ?> <div class="pad group"> <?php while ( have_posts() ): the_post(); ?> <article <?php post_class('group'); ?>> <?php get_template_part('inc/page-image'); ?> <div class="entry themeform"> <?php the_content(); ?> <div class="clear"></div> </div><!--/.entry--> </article> <?php if ( ot_get_option('page-comments') == 'on' ) { comments_template('/comments.php',true); } ?> <?php endwhile; ?> </div><!--/.pad--> </section><!--/.content--> <?php } ?> <?php get_footer(); ?>
Can someone help? thanks
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Custom Page for Logged In User’ is closed to new replies.