-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.php
129 lines (96 loc) · 5.02 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php get_header();?>
<div class="contents">
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class('page'); ?>>
<?php
echo '<article itemscope itemtype="https://schema.org/WebPage">';
if( is_front_page() ) {
echo '<h2 class="bunnypresslite_fp_h">';
the_title();
echo '</h2>';
}else{
echo '<h1 itemprop="headline name">';
the_title();
echo '</h1>';
}
if ( bunnypresslite_display_page_author() ) { ?><span class="metaauthor" itemprop="author" itemscope itemtype="https://schema.org/Person"><?php echo '<a itemprop="url" href="' . esc_url( get_author_posts_url( get_the_author_meta('ID') ) ) . '" rel="author"><span itemprop="name">'; the_author_meta('nickname'); echo '</span></a>'; ?></span><?php }else{ ?><div itemprop="author" itemscope itemtype="https://schema.org/Person"><meta itemprop="url" content="<?php echo esc_url( get_author_posts_url( get_the_author_meta('ID') ) );?>"><meta itemprop="name" content="<?php the_author_meta('nickname');?>"></div><?php }?>
<?php if ( bunnypresslite_display_page_update() && get_the_modified_date('Y-m-d') != get_the_time('Y-m-d') ) { ?>
<span class="modifi" itemprop="dateModified" content="<?php the_modified_date( 'Y-m-d' );?>"><?php the_modified_date( get_option( 'date_format' ) );?></span>
<?php }else{ ?>
<meta itemprop="dateModified" content="<?php the_modified_date( 'Y-m-d' ); ?>">
<?php }?>
<?php if ( bunnypresslite_display_page_date() ) { ?>
<span class="publish" itemprop="datePublished" content="<?php the_time( 'Y-m-d' );?>"><?php the_time( get_option( 'date_format' ) );?></span>
<?php }else{ ?>
<meta itemprop="datePublished" content="<?php the_time( 'Y-m-d' );?>">
<?php }?>
<div class="clear"></div>
<?php if( has_post_thumbnail() && bunnypresslite_display_page_thumbnail() ){
echo '<div class="bunnypresslite_content_thum">';
bunnypresslite_singular_thumbnail();
echo '</div>';
}elseif( has_post_thumbnail() && !bunnypresslite_display_page_thumbnail() ){
echo '<meta itemprop="image" content="' . esc_url( bunnypresslite_thumbnail_url() ) . '">';
}else{
echo '<meta itemprop="image" content="' . esc_url( get_template_directory_uri() . '/images/noimg.jpg' ) . '">';
}?>
<div itemprop="mainContentOfPage" class="post-content page-content">
<?php dynamic_sidebar( 'sidebar-3' ); ?>
<?php the_content(); ?>
<div class="clear"></div>
<?php
$bunnypresslite_wplinknum = wp_link_pages( array(
'before' =>'',
'after' => '',
'separator' => ' ',
'link_before' => '<span class="page-link">',
'link_after' => '</span>',
'echo' => 0
));
if( $bunnypresslite_wplinknum ) {
$bunnypresslite_pagelink = wp_link_pages( array(
'before' =>'',
'after' => '',
'link_before' => '',
'link_after' => '',
'separator' => '',
'next_or_number' => 'next',
'nextpagelink' => 'next',
'previouspagelink' => 'previous',
'echo' => 0
));
preg_match_all('|<a href="(.*?)</a>|s', $bunnypresslite_pagelink, $bunnypresslite_get_pagelink);
if( isset( $bunnypresslite_get_pagelink[0][0] ) ) {
if( strstr($bunnypresslite_get_pagelink[0][0],'previous') ) {
preg_match('|"(.*?)"|s', $bunnypresslite_get_pagelink[0][0], $bunnypresslite_get_previousurl);
$bunnypresslite_previouslink = '<a href="' . esc_url( $bunnypresslite_get_previousurl[1] ) . '"><span class="page-link">' . __('« Previous page','bunnypresslite') . '</span></a> ';
}elseif( strstr($bunnypresslite_get_pagelink[0][0],'next') ) {
preg_match('|"(.*?)"|s', $bunnypresslite_get_pagelink[0][0], $bunnypresslite_get_nexturl);
$bunnypresslite_nextlink = ' <a href="' . esc_url( $bunnypresslite_get_nexturl[1] ) . '"><span class="page-link">' . __('Next page »','bunnypresslite') . '</span></a>';
}
}
if( isset( $bunnypresslite_get_pagelink[0][1] ) ) {
if( strstr($bunnypresslite_get_pagelink[0][1],'next') ) {
preg_match('|"(.*?)"|s', $bunnypresslite_get_pagelink[0][1], $bunnypresslite_get_nexturl);
$bunnypresslite_nextlink = ' <a href="' . esc_url( $bunnypresslite_get_nexturl[1] ) . '"><span class="page-link">' . __('Next page »','bunnypresslite') . '</span></a>';
}elseif ( strstr($bunnypresslite_get_pagelink[0][1],'previous') ) {
preg_match('|"(.*?)"|s', $bunnypresslite_get_pagelink[0][1], $bunnypresslite_get_previousurl);
$bunnypresslite_previouslink = '<a href="' . esc_url( $bunnypresslite_get_previousurl[1] ) . '"><span class="page-link">' . __('« Previous page','bunnypresslite') . '</span></a> ';
}
}
echo '<nav class="center"><div class="page-links">';
if( isset( $bunnypresslite_previouslink ) ) echo wp_kses_post( $bunnypresslite_previouslink );
echo wp_kses_post( $bunnypresslite_wplinknum );
if( isset( $bunnypresslite_nextlink ) ) echo wp_kses_post( $bunnypresslite_nextlink );
echo '</div></nav>';
}
dynamic_sidebar( 'sidebar-4' );
?>
</div>
</article>
</div>
<?php comments_template( '', true ); ?>
<?php endwhile; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>