-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontent-gallery.php
102 lines (76 loc) · 2.54 KB
/
content-gallery.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
<?php
/**
* The template part used for displaying page content - GALLERY template
*
* @since olea 1.0
*
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
//
include( trailingslashit( get_template_directory() ) . 'template_vars.php' );
//
//
// CUSTOM META:
$id = get_the_ID();
$hide_title = get_post_meta( $id,'as_hide_archive_titles', true);
$hide_feat_img = get_post_meta( $id, 'as_hide_featured_image', true);
//
// AS GALLERY POST META:
//
$gall_img_array = get_post_meta( $id,'as_gallery_images' );
$gall_image_format = get_post_meta( $id,'as_gall_image_format', true ) ;
$slider_thumbs = get_post_meta( $id,'as_slider_thumbs', true );
$thumb_columns = get_post_meta( $id,'as_thumb_columns', true ) ;
//
$classes = array();
$classes[] = ($enter_anim != 'none') ? ' to-anim' : '';$thumb_columns;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class($classes); ?>>
<?php if( !$hide_title ) {?>
<a href="<?php esc_attr(the_permalink());?>" title="<?php the_title_attribute();?>" class="post-link">
<h2 class="post-title"><?php the_title(); ?></h2>
</a>
<?php } ?>
<?php as_entry_author(); ?>
<?php as_entry_date(); ?>
<?php
// WP GALLERY shortcode img id's
$wpgall_ids = apply_filters('as_wpgallery_ids','as_wp_gallery');
//
// image ID's from gallery post meta:
$images_ids = '';
if( !empty( $gall_img_array ) ) {
foreach ( $gall_img_array as $gall_img_id ){
$images_ids .= $gall_img_id .',';
}
}
if( !empty( $wpgall_ids ) ) {
$images_ids = implode(', ', $wpgall_ids); // get images from WP gallery
}else{
$images_ids = implode(', ', $gall_img_array); // get images from AS gallery
}
// function to display images with link to larger:
echo as_gallery_output( get_the_ID(), $images_ids, $slider_thumbs, $thumb_columns, $gall_image_format );
?>
<div class="post-content<?php echo $hide_feat_img ? ' no-feat-img' : ''; ?>">
<?php
do_action('as_archive_content'); // smart excerpt - "inc/functions/misc_post_functions.php"
$wlp_args = array(
'before' => '<div class="page-link"><p>' . __( 'Pages:', 'olea' ) . '</p>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
);
wp_link_pages( $wlp_args );
?>
</div>
<div class="clearfix"></div>
<div class="post-meta-bottom">
<?php
as_entryMeta_comments();
if( has_category() || has_tag() || has_term( '', 'portfolio_category' ) || has_term( '', 'portfolio_tag' ) ) {
as_entryMeta_cats_tags();
}
?>
</div>
</article><!-- #post-<?php the_ID(); ?> -->