Skip to content

Commit 69115d6

Browse files
committed
adding a new template page for logged in users
1 parent b21aa41 commit 69115d6

File tree

3 files changed

+55
-9
lines changed

3 files changed

+55
-9
lines changed

themes/cc-commoners/assets/css/extra.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,4 +372,18 @@ table.ccgn-profile tr td.title {
372372
.voucher_profile_link {
373373
margin-left: 1rem;
374374
font-size: .9rem;
375+
}
376+
377+
.cc-content-area .block-area {
378+
padding-top: 3rem;
379+
}
380+
.cc-content-area .block-area .entry-content {
381+
min-height: 60vh !important;
382+
}
383+
.cc-content-area .block-area .entry-content.not-login {
384+
margin-top: 10rem;
385+
}
386+
.entry-content p {
387+
margin: 1.2rem 0;
388+
line-height: 1.8rem;
375389
}

themes/cc-commoners/template-content.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@
66

77
get_header();
88
?>
9+
<div class="cc-content-area">
10+
<div class="inner-section-title">
11+
<h1><?php the_title(); ?></h1>
12+
</div>
13+
<div class="block-area">
914

10-
<div class="inner-section-title">
11-
<h1><?php the_title(); ?></h1>
12-
</div>
13-
<div class="block-area">
14-
15-
<div class="inner-section-list entry-content">
15+
<div class="inner-section-list entry-content">
1616

17-
<?php get_template_part('template-parts/loop/frontpage-loop'); ?>
17+
<?php get_template_part('template-parts/loop/frontpage-loop'); ?>
1818

19-
</div>
19+
</div>
2020

21-
</div><!--/.block-area-->
21+
</div><!--/.block-area-->
22+
</div>
2223

2324
<?php get_footer(); ?>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/*
4+
Template Name: Logged in content Page
5+
*/
6+
7+
get_header();
8+
?>
9+
<div class="cc-content-area">
10+
<?php if (is_user_logged_in()): ?>
11+
<div class="inner-section-title">
12+
<h1><?php the_title(); ?></h1>
13+
</div>
14+
<?php endif; ?>
15+
<div class="block-area">
16+
<?php $logged_class = (is_user_logged_in()) ? 'login' : 'not-login'; ?>
17+
<div class="inner-section-list entry-content <?php echo $logged_class ?>">
18+
<?php if (is_user_logged_in()) : ?>
19+
<?php get_template_part('template-parts/loop/frontpage-loop'); ?>
20+
<?php else: ?>
21+
<div class="callout warning">
22+
<h5>Sorry</h5>
23+
<p>You have to be logged in to see this content</p>
24+
</div>
25+
<?php endif; ?>
26+
</div>
27+
28+
</div><!--/.block-area-->
29+
</div>
30+
31+
<?php get_footer(); ?>

0 commit comments

Comments
 (0)