PluginProbe
Sight – Professional Image Gallery and Portfolio / 1.1.6
Sight – Professional Image Gallery and Portfolio v1.1.6
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8
sight / render / handler / post-area-post.php

post-area-post.php in Sight – Professional Image Gallery and Portfolio 1.1.6, at render/handler/post-area-post.php

58 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Portfolio Post
4 *
5 * @var $attributes - attributes
6 * @var $options - options
7 *
8 * @link https://codesupply.co
9 * @since 1.0.0
10 *
11 * @package Sight
12 */
13
14 $class_name = sight_portfolio_area_classes( $attributes, $options );
15
16 if ( $attributes['custom_post'] ) {
17 $attachments = get_attached_media( 'image', $attributes['custom_post'] );
18
19 if ( $attachments && count( $attachments ) > $attributes['number_items'] ) {
20 $attachments = array_slice( $attachments, 0, $attributes['number_items'] );
21 }
22 }
23
24 if ( isset( $attachments ) && $attachments ) {
25 ?>
26 <div class="<?php echo esc_attr( $class_name ); ?>">
27
28 <div class="sight-portfolio-area__outer">
29 <div class="sight-portfolio-area__main" <?php sight_portfolio_area_main_attrs( $attributes, $options ); ?>>
30 <?php
31 // Start the Loop.
32 foreach ( $attachments as $attachment ) {
33
34 // Get item project.
35 if ( wp_get_attachment_image( $attachment->ID ) ) {
36
37 $portfolio_entry = new Sight_Entry( $attributes, $options );
38
39 // Set settings.
40 $portfolio_entry->attachment_id = $attachment->ID;
41
42 // Init portfolio entry.
43 $portfolio_entry->init();
44
45 require apply_filters( 'sight_portfolio_item_path', SIGHT_PATH . 'render/handler/portfolio-entry.php', $attributes, $options, $portfolio_entry );
46 }
47 }
48 ?>
49 </div>
50 </div>
51 </div>
52 <?php
53 } else {
54 require SIGHT_PATH . 'render/handler/post-area-none.php';
55 }
56
57 wp_reset_postdata();
58