/
portfolio-sidebar-square-bw.php
executable file
·107 lines (107 loc) · 7.14 KB
/
portfolio-sidebar-square-bw.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
<?php
/*
Template Name: Portfolio - Sidebar - Square B&W
*/
get_header(); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php
$content = get_the_content();
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
$title = get_the_title();
?>
<?php endwhile; ?>
<?php $portfolios = portfolio_require(); ?>
<?php $pagination = get_option('portfolio-sidebar-square'); ?>
<?php foreach ( $portfolios as $portfolio) :?>
<?php if ( is_page($portfolio->PAGE)): ?>
<div id="content-wrapper">
<?php get_sidebar(); ?>
<div id="content">
<?php $slider_display = get_option('slider_display'); if ( $slider_display == '' ) $slider_display = '1'; else $slider_display = get_option('slider_display'); ?>
<?php if ( $slider_display == 0 ) : ?>
<h1 class="page-title">
<?php echo $title; ?>
</h1>
<?php endif; ?>
<?php if ($post->post_parent): ?>
<?php $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); ?>
<?php else: ?>
<?php $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); ?>
<?php endif; ?>
<?php if ($children) : ?>
<ul class="portfolio-sub-pages">
<?php if ( $post->post_parent == 0 ) : ?>
<li class="current_page_item"><a href="<?php echo the_permalink(); ?>"><?php echo __('View all','duotive'); ?></a></li>
<?php else: ?>
<?php $permalink = get_permalink($post->post_parent); ?>
<li><a href="<?php echo $permalink; ?>"><?php echo __('View all','duotive'); ?></a></li>
<?php endif; ?>
<?php echo $children; ?>
</ul>
<?php endif; ?>
<?php if ( $content != '' ): ?>
<div class="portfolio-description">
<?php echo $content; ?>
<!-- end of portfolio description -->
</div>
<?php endif; ?>
<?php
global $more;
$more = 0;
if ( is_front_page () ) $paged = get_query_var( 'page' );
$wp_query = new WP_Query('post_type=post&posts_per_page='.$pagination.'&cat='.$portfolio->CATEGORY.'&paged=' . $paged);
if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();
?>
<div class="portfolio-one-column-square">
<?php if ( has_post_thumbnail() ): ?>
<?php $thumbnail_src = wp_get_attachment_url( get_post_thumbnail_id($post->ID ) ); ?>
<?php $behaviour = get_post_meta($post->ID, "behaviour", true); ?>
<?php if ( $behaviour == '' || $behaviour == 'Open portfolio item' ) : ?>
<?php $website_url = get_bloginfo('wpurl'); ?>
<?php $thumbnail_src = str_replace($website_url,'', $thumbnail_src); ?>
<a class="portfolio-image" href="<?php the_permalink(); ?>" title="<?php the_title();?>">
<span class="portfolio-icon square-icon-read-more"></span>
<img class=" blackandwhite" src="<?php echo get_bloginfo('template_directory');?>/includes/timthumb.php?src=<?php echo $thumbnail_src; ?>&h=168&w=168&zc=1&q=100&f=2" alt="<?php the_title(); ?>" />
<img src="<?php echo get_bloginfo('template_directory');?>/includes/timthumb.php?src=<?php echo $thumbnail_src; ?>&h=168&w=168&zc=1&q=100" alt="<?php the_title(); ?>" />
</a>
<?php endif; ?>
<?php if ( $behaviour == 'Open image in modal' ) : ?>
<a class="portfolio-image" href="<?php echo $thumbnail_src; ?>" rel="portfolio[modal]" title="<?php the_title();?>">
<span class="portfolio-icon square-icon-zoom"></span>
<img class=" blackandwhite" src="<?php echo get_bloginfo('template_directory');?>/includes/timthumb.php?src=<?php echo $thumbnail_src; ?>&h=168&w=168&zc=1&q=100&f=2" alt="<?php the_title(); ?>" />
<img src="<?php echo get_bloginfo('template_directory');?>/includes/timthumb.php?src=<?php echo $thumbnail_src; ?>&h=168&w=168&zc=1&q=100" alt="<?php the_title(); ?>" />
</a>
<?php endif; ?>
<?php if ( $behaviour == 'Open video in modal' ) : ?>
<?php $video_url = get_post_meta($post->ID, "portfolio-video", true); ?>
<a class="portfolio-image" href="<?php echo $video_url; ?>" rel="portfolio[modal]" title="<?php the_title();?>">
<span class="portfolio-icon square-icon-video"></span>
<img class=" blackandwhite" src="<?php echo get_bloginfo('template_directory');?>/includes/timthumb.php?src=<?php echo $thumbnail_src; ?>&h=168&w=168&zc=1&q=100&f=2" alt="<?php the_title(); ?>" />
<img src="<?php echo get_bloginfo('template_directory');?>/includes/timthumb.php?src=<?php echo $thumbnail_src; ?>&h=168&w=168&zc=1&q=100" alt="<?php the_title(); ?>" />
</a>
<?php endif; ?>
<?php endif; ?>
<div class="portfolio-content">
<h2>
<a href="<?php the_permalink(); ?>" title="<?php echo __('Permalink to ', 'duotive').the_title_attribute( 'echo=0' ); ?>" rel="bookmark">
<?php the_title(); ?>
</a>
</h2>
<?php the_content(''); ?>
<a class="more-link" href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php echo __('Read More »','duotive'); ?></a>
</div>
</div>
<?php endwhile;endif;?>
<?php if(function_exists('wp_pagenavi')): ?>
<div id="navigation">
<?php wp_pagenavi();?>
</div>
<?php endif; ?>
<!-- end of content -->
</div>
<!-- end of content wrapper -->
</div>
<?php endif;?>
<?php endforeach;?>
<?php get_footer(); ?>