-
Notifications
You must be signed in to change notification settings - Fork 1
/
single-portfolio.php
executable file
·143 lines (114 loc) · 7.45 KB
/
single-portfolio.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php get_header(); ?>
<?php get_template_part('menu_section'); ?>
<div class="section post-single"><!-- SECTION -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="container">
<div class="row">
<div class="sixteen columns">
<!-- START TITLE -->
<div class="title">
<h1 class="header-text"><?php if(get_post_meta( get_the_ID(), 'rnr_alt_title', true )){ echo get_post_meta( get_the_ID(), 'rnr_alt_title', true ); } else { the_title(); } ?></h1>
</div><!-- END TITLE -->
</div><!-- END SIXTEEN COLUMNS -->
</div><!-- END ROW -->
</div><!-- END CONTAINER -->
<?php endwhile;
endif;
wp_reset_query();
?>
<div class="container">
<div class="row">
<div id="ajaxpage">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="<?php if($smof_data['rnr_portfolio_single_type']=="Side By Side") { echo 'eleven columns';} else { echo 'sixteen columns'; } ?> project-media">
<?php if( get_post_meta( get_the_ID(), 'rnr_project_video_embed', true ) == "" ){ ?>
<?php
$slider_meta = get_post_meta( get_the_ID( ), 'rnr_project_item_slides', false );
if(!empty($slider_meta)) { ?>
<div class="flexslider">
<ul class="slides">
<?php global $wpdb, $post;
if ( !is_array( $slider_meta ) )
$slider_meta = ( array ) $slider_meta;
if ( !empty( $slider_meta ) ) {
$slider_meta = implode( ',', $slider_meta );
$images = $wpdb->get_col( "
SELECT ID FROM $wpdb->posts
WHERE post_type = 'attachment'
AND ID IN ( $slider_meta )
ORDER BY menu_order ASC
" );
foreach ( $images as $att ) {
// Get image's source based on size, can be 'thumbnail', 'medium', 'large', 'full' or registed post thumbnails sizes
$image_src = wp_get_attachment_image_src( $att, 'full' );
$image_src2= wp_get_attachment_image_src( $att, '');
$image_src = $image_src[0];
$image_src2 = $image_src2[0];
// Show image
echo "<li><img src='{$image_src}' /></li>";
}
} ?>
</ul>
</div><!-- end of portfolio slider -->
<?php } if ( has_post_thumbnail()) { ?>
<?php if (empty($slider_meta)) { ?>
<?php
$att=get_post_thumbnail_id();
$image_src = wp_get_attachment_image_src( $att, 'full' );
$image_src = $image_src[0];
?>
<span><?php the_post_thumbnail('full'); ?></span>
<?php } ?>
<?php } ?>
<?php } else { ?>
<?php
if (get_post_meta( get_the_ID(), 'rnr_project_video_type', true ) == 'vimeo') {
echo '<div id="portfolio-video"><iframe src="http://player.vimeo.com/video/'.get_post_meta( get_the_ID(), 'rnr_project_video_embed', true ).'?title=0&byline=0&portrait=0&color=ffffff" width="960" height="540" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>';
}
else if (get_post_meta( get_the_ID(), 'rnr_project_video_type', true ) == 'youtube') {
echo '<div id="portfolio-video"><iframe width="960" height="540" src="http://www.youtube.com/embed/'.get_post_meta( get_the_ID(), 'rnr_project_video_embed', true ).'?rel=0&showinfo=0&modestbranding=1&hd=1&autohide=1&color=white" frameborder="0" allowfullscreen></iframe></div>';
}
?>
<?php } ?>
</div><!-- end of span -->
<div class="<?php if($smof_data['rnr_portfolio_single_type']=="Side By Side") { echo 'five columns';} else { echo 'sixteen columns'; } ?>">
<!-- START PROJECT INFO -->
<div class="project-info">
<div class="portfolio-description">
<h3><span><?php echo $smof_data['rnr_portfolio_description_title']; ?></span></h3>
<div class="portfolio-detail-description-text"><?php the_content(); ?></div>
</div>
<?php if( get_post_meta( get_the_ID(), 'rnr_project_details', true ) == 1 ) { ?>
<div class="project-details">
<h3><span><?php echo $smof_data['rnr_portfolio_details_title']; ?></span></h3>
<?php if( get_post_meta( get_the_ID(), 'rnr_project_client_name', true ) != "") { ?>
<p><strong><?php _e('Client: ', 'rocknrolla'); ?></strong> <?php echo get_post_meta( get_the_ID(), 'rnr_project_client_name', true ); ?></p>
<?php } ?>
<p><strong><?php _e('Tags: ', 'rocknrolla'); ?></strong> <?php $taxonomy = strip_tags( get_the_term_list($post->ID, 'portfolio_filter', '', ', ', '') ); echo $taxonomy; ?></p>
<?php if( get_post_meta( get_the_ID(), 'rnr_project_link', true ) != "") { ?>
<a href="<?php echo get_post_meta( get_the_ID(), 'rnr_project_link', true ); ?>" target="_blank" class="button"><?php _e('View Project', 'rocknrolla'); ?></a>
<?php } ?>
</div><!-- end of portfolio detail -->
</div><!-- end of span -->
<?php } ?>
</div>
</div>
<div class="clear"></div>
<?php endwhile; endif;
wp_reset_query(); ?>
</div> <!-- end of ajaxpage -->
</div><!--END CONTAINER -->
<div class="container">
<div class="row">
<div class="span12">
<div class="posts-nav">
<?php next_post_link( '<span class="next right">%link</span>', '%title <i class="icon-circle-arrow-right"></i>', FALSE); ?>
<?php previous_post_link( '<span class="prev left">%link</span>', '<i class="icon-circle-arrow-left"></i> %title', FALSE); ?>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
</div><!--END SECTION -->
<?php get_footer(); ?>