-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-portfolio.php
81 lines (62 loc) · 3.08 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
<?php get_header();
// Layout
$position = (get_post_meta( get_the_ID(), 'bangla_page_layout', true )) ? get_post_meta( get_the_ID(), 'bangla_page_layout', true ) : get_theme_mod( 'bangla_page_layout', 'sidebar-right' );
$width = '1-3';
$class = 'broxme_wp-portfolio-sidebar';
?>
<div<?php echo bangla_helper::section(); ?>>
<div<?php echo bangla_helper::container(); ?>>
<div<?php echo bangla_helper::grid(); ?>>
<div class="broxme_wp-width-expand">
<main class="broxme_wp-content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php get_template_part( 'template-parts/portfolio/entry' ); ?>
<?php get_template_part( 'template-parts/author' ); ?>
<?php if( get_theme_mod( 'bangla_related_post' ) ) { ?>
<?php //for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags( $post->ID );
if( $tags ) {
?>
<div id="related-posts">
<h3 class="broxme_wp-heading-bullet broxme_wp-margin-medium-bottom"><?php esc_hbroxme_wpl_e('Related Posts', 'bangla'); ?></h3>
<ul class="broxme_wp-list broxme_wp-list-divider">
<?php $first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'showposts'=>4
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Link to <?php the_title_attribute(); ?>" class="broxme_wp-link-reset broxme_wp-margin-small-right"><?php the_title(); ?></a> <span class="broxme_wp-article-meta"><?php the_time(get_option('date_format')); ?></span></li>
<?php
endwhile; wp_reset_postdata(); } ?>
</ul>
</div>
<hr class="broxme_wp-margin-large-top broxme_wp-margin-large-bottom">
<?php } // end if $tags ?>
<?php } ?>
<?php comments_template(); ?>
<?php if( get_theme_mod( 'bangla_portfolio_next_prev', 1 ) ) { ?>
<hr>
<ul class="broxme_wp-pagination">
<li>
<?php
$pre_btn_txt = '<span class="broxme_wp-margin-small-right" broxme_wp-pagination-previous></span> '. esc_html__('Previous', 'bangla');
previous_post_link('%link', "{$pre_btn_txt}", FALSE);
?>
</li>
<li class="broxme_wp-margin-auto-left">
<?php $next_btn_txt = esc_html__('Next', 'bangla') . ' <span class="broxme_wp-margin-small-left" broxme_wp-pagination-next></span>';
next_post_link('%link', "{$next_btn_txt}", FALSE); ?>
</li>
</ul>
<?php } ?>
<?php endwhile; endif; ?>
</main> <!-- end main -->
</div> <!-- end expand -->
</div> <!-- end grid -->
</div> <!-- end container -->
</div> <!-- end broxme_wp main -->
<?php get_footer(); ?>