-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.php
53 lines (35 loc) · 1.2 KB
/
page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
$page_id = "";
if ( is_single() || is_page() ) {
$page_id = get_the_ID();
} else if ( is_home() ) {
$page_id = get_option('page_for_posts');
}
$page_title_option = "on";
if (get_post_meta( $page_id, 'page_title_meta_box_check', true )) {
$page_title_option = get_post_meta( $page_id, 'page_title_meta_box_check', true );
}
?>
<?php get_header(); ?>
<div class="page-template">
<?php if ( (isset($page_title_option)) && ($page_title_option == "on") ) : ?>
<h1 class="text-center"><?php the_title(); ?></h1>
<?php endif; ?>
<!-- Widget on top of the page -->
<?php if (is_page() && is_active_sidebar( 'top_page' ) ) : ?>
<div class="col" >
<?php dynamic_sidebar( 'top_page' ); ?>
</div>
<?php endif; ?>
<!--End Widget on top of the page -->
<?php
while ( have_posts() ) : the_post(); ?> <!--Because the_content() works only inside a WP Loop -->
<div>
<?php the_content(); ?> <!-- Page Content -->
</div><!-- .entry-content-page -->
<?php
endwhile; //resetting the page loop
wp_reset_query(); //resetting the page query
?>
</div>
<?php get_footer(); ?>