-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
141 lines (140 loc) · 6 KB
/
single.php
File metadata and controls
141 lines (140 loc) · 6 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/**
* The template for displaying all single posts.
*
* @package Theme Freesia
* @subpackage Event
* @since Event 1.0
*/
get_header();
$event_settings = event_get_theme_options();
global $event_content_layout;
if( $post ) {
$layout = get_post_meta( get_queried_object_id(), 'event_sidebarlayout', true );
}
if( empty( $layout ) || is_archive() || is_search() || is_home() ) {
$layout = 'default';
}
if( 'default' == $layout ) { //Settings from customizer
if(($event_settings['event_sidebar_layout_options'] != 'nosidebar') && ($event_settings['event_sidebar_layout_options'] != 'fullwidth')){ ?>
<div id="primary">
<?php }
}else{ // for page/ post
if(($layout != 'no-sidebar') && ($layout != 'full-width')){ ?>
<div id="primary">
<?php }
}?>
<div id="main" class="clearfix">
<?php global $event_settings;
if( have_posts() ) {
while( have_posts() ) {
the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class();?>>
<header class="entry-header">
<?php if( has_post_thumbnail()) { ?>
<div class="post-image-content">
<figure class="post-featured-image">
<a href="<?php the_permalink();?>" title="<?php echo the_title_attribute('echo=0'); ?>">
<?php the_post_thumbnail( 'full' ); ?>
</a>
</figure><!-- end.post-featured-image -->
</div> <!-- end.post-image-content -->
<?php } ?>
<?php the_title( '<h1 itemprop="headline" class="entry-title single-title">', '</h1>' ); ?>
<?php
$entry_format_meta_blog = $event_settings['event_entry_meta_blog'];
if($entry_format_meta_blog == 'show-meta' ){?>
<div class="entry-meta">
<?php
$format = get_post_format();
if ( current_theme_supports( 'post-formats', $format ) ) {
printf( '<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>',
sprintf( ''),
esc_url( get_post_format_link( $format ) ),
get_post_format_string( $format )
);
} ?>
<span class="author vcard"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php the_author(); ?>">
<i class="fa fa-user"></i>
<?php the_author(); ?> </a></span>
<span class="posted-on"><a title="<?php echo esc_attr( get_the_time() ); ?>" href="<?php the_permalink(); ?>">
<i class="fa fa-calendar"></i>
<?php the_time( get_option( 'date_format' ) ); ?> </a></span>
<?php if ( comments_open() ) { ?>
<span class="comments"><i class="fa fa-comments"></i>
<?php comments_popup_link( __( 'No Comments', 'event' ), __( '1 Comment', 'event' ), __( '% Comments', 'event' ), '', __( 'Comments Off', 'event' ) ); ?> </span>
<?php } ?>
<span class="cat-links">
<?php the_category(', '); ?>
</span> <!-- end .cat-links -->
</div> <!-- end .entry-meta -->
<?php } ?>
</header> <!-- end .entry-header -->
<?php $featured_image_display = $event_settings['event_single_post_image'];
if($featured_image_display == 'on'):
if( has_post_thumbnail() ) { ?>
<div class="post-image-content">
<figure class="post-featured-image">
<?php the_post_thumbnail(); ?>
</figure><!-- end.post-featured-image -->
</div> <!-- end.post-image-content -->
<?php }
endif; ?>
<div class="entry-content clearfix">
<?php the_content();
wp_link_pages( array(
'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'event' ),
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '%',
'echo' => 1
) ); ?>
</div> <!-- .entry-content -->
<?php $disable_entry_format = $event_settings['event_entry_format_blog'];
if($disable_entry_format =='show' || $disable_entry_format =='show-button' || $disable_entry_format =='hide-button'){ ?>
<footer class="entry-footer">
<div class="entry-meta">
<?php if($disable_entry_format !='show-button'){ ?>
<?php $tag_list = get_the_tag_list( '', __( ', ', 'event' ) );
if(!empty($tag_list)){ ?>
<span class="tag-links">
<?php echo get_the_tag_list( '', __( ', ', 'event' ) ); ?>
</span> <!-- end .tag-links -->
<?php }
} ?>
</div><!-- end .entry-meta -->
</footer> <!-- .entry-meta -->
<?php }
// if( is_attachment() ) { ?>
<!-- <ul class="default-wp-page clearfix">-->
<!-- <li class="previous"> --><?php //previous_image_link( false, __( '← Previous', 'event' ) ); ?><!-- </li>-->
<!-- <li class="next"> --><?php //next_image_link( false, __( 'Next →', 'event' ) ); ?><!-- </li>-->
<!-- </ul>-->
<!-- --><?php //} else { ?>
<!-- <ul class="default-wp-page clearfix">-->
<!-- <li class="previous"> --><?php //previous_post_link( '%link', '<span class="meta-nav"><i class="fa fa-angle-left" aria-hidden="true"></i>' . _x( '', 'Previous post link', 'event' ) . '</span> %title' ); ?><!-- </li>-->
<!-- <li class="next"> --><?php //next_post_link( '%link', '%title <span class="meta-nav"><i class="fa fa-angle-right" aria-hidden="true"></i>' . _x( '', 'Next post link', 'event' ) . '</span>' ); ?><!-- </li>-->
<!-- </ul>-->
<!-- --><?php //}
comments_template(); ?>
</article>
</section> <!-- .post -->
<?php }
}
else { ?>
<h1 class="entry-title"> <?php esc_html_e( 'No Posts Found.', 'event' ); ?> </h1>
<?php } ?>
</div> <!-- #main -->
<?php
if( 'default' == $layout ) { //Settings from customizer
if(($event_settings['event_sidebar_layout_options'] != 'nosidebar') && ($event_settings['event_sidebar_layout_options'] != 'fullwidth')): ?>
</div> <!-- #primary -->
<?php endif;
}else{ // for page/post
if(($layout != 'no-sidebar') && ($layout != 'full-width')){
echo '</div><!-- #primary -->';
}
}
get_sidebar();
get_footer();