-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle-directory.php
More file actions
132 lines (94 loc) · 4.48 KB
/
Copy pathsingle-directory.php
File metadata and controls
132 lines (94 loc) · 4.48 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
<?php
/**
* The Template for displaying all single directory item
*/
global $post;
$single_map = woffice_get_directory_single_map();
$single_fields = woffice_get_directory_single_fields('single');
$current_user_is_admin = woffice_current_is_admin();
$edit_allowed = (Woffice_Frontend::edit_allowed('directory') == true) ? true : false;
$delete_allowed = (Woffice_Frontend::edit_allowed('directory', 'delete') == true) ? true : false;
if ($edit_allowed) {
$process_result = Woffice_Frontend::frontend_process('directory', $post->ID);
}
get_header(); ?>
<?php // Start the Loop.
while ( have_posts() ) : the_post(); ?>
<div id="left-content">
<?php //GET THEME HEADER CONTENT
woffice_title(get_the_title()); ?>
<!-- START THE CONTENT CONTAINER -->
<div id="content-container">
<!-- START CONTENT -->
<div id="content">
<?php Woffice_Frontend::frontend_render('post',$hasError); ?>
<?php $post_classes = array('box','content'); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class($post_classes); ?>>
<div class="intern-padding">
<div class="fw-container">
<div class="row">
<?php if ( $single_map || $single_fields )
echo '<div class="col-md-6">';
?>
<?php /* The content + the excerpt */
the_excerpt();
?>
<?php /* The Button */
$item_button_link = ( function_exists( 'fw_get_db_post_option' ) ) ? fw_get_db_post_option(get_the_ID(), 'item_button_link') : '';
if (!empty($item_button_link)) {
$item_button_text = ( function_exists( 'fw_get_db_post_option' ) ) ? fw_get_db_post_option(get_the_ID(), 'item_button_text') : '';
$item_button_icon = ( function_exists( 'fw_get_db_post_option' ) ) ? fw_get_db_post_option(get_the_ID(), 'item_button_icon') : '';
$icon = (!empty($item_button_icon)) ? '<i class="'. woffice_convert_fa4_to_fa5($item_button_icon) .'"></i> ' : '';
echo '<hr>';
echo '<div class="text-center">';
echo '<a href="'.$item_button_link.'" class="btn btn-default">'.$icon . $item_button_text.'</a>';
echo '</div>';
} ?>
<?php if ( $single_map || $single_fields) {
echo '</div>';
echo '<div class="col-md-6">';
}
?>
<?php echo woffice_get_directory_single_map(); ?>
<?php echo woffice_get_directory_single_fields('single'); ?>
<?php if ( $single_map || $single_fields) {
echo '</div>';
}
?>
</div>
<?php /* Categories */
if( has_term('', 'directory-category')):
echo '<span class="directory-category"><i class="fa fa-tag"></i>';
echo get_the_term_list( $post->ID, 'directory-category', '', ', ' );
echo '</span>';
endif; ?>
</div>
<?php woffice_post_nav(); ?>
</div>
</article>
<div class="frontend-wrapper box">
<div class="intern-padding frontend-wrapper">
<div class="text-center" id="directory-bottom">
<?php if ($edit_allowed) : ?>
<a href="#" class="btn btn-default frontend-wrapper__toggle" data-action="display"><i class="fa fa-edit"></i> <?php _e("Edit Item", "woffice"); ?></a>
<?php endif; ?>
</div>
<?php if ($edit_allowed) : ?>
<?php Woffice_Frontend::frontend_render('directory', $process_result, get_the_ID()); ?>
<?php endif; ?>
</div>
</div>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
?>
</div>
</div><!-- END #content-container -->
<?php woffice_scroll_top(); ?>
</div><!-- END #left-content -->
<?php // END THE LOOP
endwhile; ?>
<?php
get_footer();