This repository was archived by the owner on Nov 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsingle-portfolio.php
More file actions
executable file
·86 lines (69 loc) · 3.15 KB
/
single-portfolio.php
File metadata and controls
executable file
·86 lines (69 loc) · 3.15 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
<?php
/**
* Single portfolio post content
*
* @package Adapt WordPress Theme
* @subpackage Templates
* @version 3.0.0
*/
// Get main header
get_header();
// Main post loop
while ( have_posts() ) : the_post(); ?>
<article>
<header id="page-heading">
<h1><?php the_title(); ?></h1>
<nav id="single-nav" class="clearfix">
<?php next_post_link('<div id="single-nav-left">%link</div>', '<span class="fa fa-chevron-left"></span> '.__('Newer','wpex-adapt').'', false); ?>
<?php previous_post_link('<div id="single-nav-right">%link</div>', ''.__('Older','wpex-adapt').' <span class="fa fa-chevron-right"></span>', false); ?>
</nav><!-- #single-nav -->
</header><!-- #page-heading -->
<div id="single-portfolio" class="content-area full-width clearfix">
<div id="single-portfolio-left">
<?php
// Check for portfolio alternative media custom field (meta)
if ( get_post_meta( get_the_ID(), 'wpex_portfolio_post_media_alternative', true ) ) { ?>
<div id="portfolio-post-alt" class="clearfix fitvids">
<?php
// Display alternative media
echo apply_filters( 'the_content', get_post_meta( get_the_ID(), 'wpex_portfolio_post_media_alternative', true ) ); ?>
</div><!-- #portfolio-post-alt -->
<?php }
// Display slider
elseif ( $attachments = wpex_get_gallery_ids() ) {
// Load the slider js if there is more then one attachment
if ( count( $attachments ) > '1' ) {
wp_enqueue_script( 'flexslider' );
wp_enqueue_script( 'wpex-slider-home', WPEX_JS_DIR .'/slider-portfolio.js', array( 'jquery', 'flexslider' ), '1.0', true );
} ?>
<div id="portfolio-post-slider" class="clearfix">
<div class="<?php if ( count( $attachments ) > '1' ) echo 'flexslider'; ?>">
<ul class="slides">
<?php
// Loop through gallery images
foreach ( $attachments as $attachment ) :
// Get image alt
$img_alt = strip_tags( get_post_meta( $attachment, '_wp_attachment_image_alt', true ) );?>
<li><a href="<?php echo wp_get_attachment_url( $attachment ); ?>" title="<?php echo esc_attr( $img_alt ); ?>" <?php if ( '1' == count( $attachments ) ) { echo 'class="prettyphoto-link"'; } else { echo 'rel="prettyphoto[gallery]"'; } ?>><?php echo wp_get_attachment_image( $attachment, 'wpex_portfolio_post' ); ?></a></li>
<?php endforeach; ?>
</ul>
</div><!-- .flex-slider -->
</div><!-- #portfolio-post-slider -->
<?php }
// Display featured image
elseif ( has_post_thumbnail() ) { ?>
<div id="single-portfolio-thumbnail" class="clearfix">
<?php
// Get thumbnail url
$thumbnail_url = wp_get_attachment_url( get_post_thumbnail_id() ); ?>
<a href="<?php echo esc_url( $thumbnail_url ); ?>" title="<?php wpex_esc_title(); ?>" class="prettyphoto-link"><?php the_post_thumbnail( 'wpex_portfolio_post' ); ?></a>
</div><!-- #single-portfolio-thumbnail -->
<?php } ?>
</div><!-- /single-portfolio-left -->
<div id="single-portfolio-right" class="clearfix">
<?php the_content(); ?>
</div><!-- #single-portfolio-right -->
</div><!-- #post -->
</article>
<?php endwhile; ?>
<?php get_footer(); ?>