This repository was archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsingle-portfolio.php
More file actions
158 lines (108 loc) · 4.37 KB
/
single-portfolio.php
File metadata and controls
158 lines (108 loc) · 4.37 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php
/**
* The template for displaying the portfolio singular page
*
* @package Wonder
* @link https://themebeans.com/themes/wonder
*/
get_header();
// SETTING UP META
$portfolio_type = get_post_meta( $post->ID, '_bean_portfolio_type', true );
$portfolio_date = get_post_meta( $post->ID, '_bean_portfolio_date', true );
$portfolio_url = get_post_meta( $post->ID, '_bean_portfolio_url', true );
$portfolio_url_text = get_post_meta( $post->ID, '_bean_portfolio_url_text', true );
$portfolio_client = get_post_meta( $post->ID, '_bean_portfolio_client', true );
$portfolio_cats = get_post_meta( $post->ID, '_bean_portfolio_cats', true );
$portfolio_tags = get_post_meta( $post->ID, '_bean_portfolio_tags', true );
$gallery_layout = get_post_meta( $post->ID, '_bean_gallery_layout', true );
// RELATED POSTS
$terms = get_the_terms( $post->ID, 'portfolio_category' );
?>
<div id="primary-container">
<div class="portfolio-title-container fadein">
<div class="row">
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-meta">
<ul class="portfolio-meta-list">
<?php if ( $portfolio_date == 'on' ) { // DISPLAY DATE ?>
<li><span><?php esc_html_e( 'Date: ', 'wonder' ); ?></span><?php echo the_time( 'M Y' ); ?></li>
<?php } // END DATE ?>
<?php if ( $portfolio_client ) { // DISPLAY CLIENT ?>
<li>
<span><?php esc_html_e( 'Client:', 'wonder' ); ?></span>
<?php if ( $portfolio_url ) { // DISPLAY PORTFOLIO URL ?>
<a href="<?php echo esc_url( $portfolio_url ); ?>" target="blank"><?php echo esc_html( $portfolio_client ); ?></a>
<?php
} else {
echo esc_html( $portfolio_client ); } // IF NO URL
?>
</li>
<?php } // END CLIENT ?>
<?php if ( $portfolio_cats == 'on' ) { // DISPLAY CATEGORY ?>
<li><span><?php esc_html_e( 'Skills: ', 'wonder' ); ?></span><?php the_terms( $post->ID, 'portfolio_category', '', ', ', '' ); ?></li>
<?php } // END CATEGORY ?>
<?php if ( $portfolio_tags == 'on' ) { // DISPLAY TAGS ?>
<li><span><?php esc_html_e( 'Tags: ', 'wonder' ); ?></span><?php the_terms( $post->ID, 'portfolio_tag', '', ', ', '' ); ?></li>
<?php } // END TAGS ?>
</ul><!--END .portfolio-meta-list -->
</div><!-- END .entry-meta-->
</div><!-- END .row -->
<?php if ( get_theme_mod( 'portfolio_pagination' ) == true ) { ?>
<div class="pagination hide-for-small">
<span class="page-previous BeanFadeInLeft">
<?php previous_post_link( '%link', '' ); ?>
</span><!-- END .page-previous -->
<span class="page-next BeanFadeInRight">
<?php next_post_link( '%link', '' ); ?>
</span><!-- END .page-next -->
</div><!-- END .pagination -->
<?php } //END IF PORTFOLIO PAGINATION ?>
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<div class="row">
<div class="entry-content">
<?php the_content(); // CONTENT ?>
</div><!-- END .entry-content-->
</div><!-- END .row -->
</div><!-- END .portfolio-title-container-->
<?php
// BACKSTRECH IMAGE
$bgwidth = get_post_meta( get_the_ID(), '_bean_bgwidth', true );
$bgimage = get_post_meta( get_the_ID(), '_bean_bgimage', true );
$bg_class = '';
$data_url = '';
if ( $bgwidth == 'backstretch' && $bgimage !== '' ) {
$data_url = " data-url='$bgimage'";
$bg_class = " class= 'backstretch'";
}
?>
<div id="media-container"
<?php
echo esc_attr( $bg_class );
echo esc_attr( $data_url );
?>
>
<?php if ( ! post_password_required() ) { // START PASSWORD PROTECTED MEDIA ?>
<div class="entry-content-media portfolio-<?php echo esc_attr( $portfolio_type ); ?> <?php echo esc_attr( $gallery_layout ); ?>">
<?php get_template_part( 'content', 'portfolio-media' ); // PULL CONTENT-PORTFOLIO-MEDIA.PHP ?>
</div><!-- END .entry-content-media -->
<?php } //END PASSWORD PROTECTED MEDIA ?>
</div><!-- END #media-container -->
<?php
endwhile;
endif;
wp_reset_postdata();
?>
<?php
if ( $terms && ! is_wp_error( $terms ) ) : // IF NO CATEGORY - DONT GET TEMPLATE PART
if ( get_theme_mod( 'show_related_portfolio_posts' ) == true ) {
get_template_part( 'content', 'portfolio-related' ); // PULL CONTENT-PORTFOLIO-RELATED.PHP
} //END IF SHOW RELATED POSTS
endif;
?>
</div><!-- END #primary-container -->
<?php
get_footer();