PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
themes
/
wpnull24
/
framework
/
templates
/
elements
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' ); /** * Shortcode: Gallery * * Dev note: if you want to change some of the default values or acceptable attributes, overload the shortcodes config. * * @var $shortcode string Current shortcode name * @var $shortcode_base string The original called shortcode name (differs if called an alias) * @var $content string Shortcode's inner content * */ if ( empty( $ids ) ) { return; } $classes = ''; // Columns $columns = intval( $columns ); if ( $columns != 1 ) { $classes .= ' cols_' . $columns; } // Link type if ( $link == 'none' ) { $link_type = 'none'; } elseif ( $link == 'file' ) { $link_type = 'file'; } else { $link_type = 'attachment'; } $classes .= ' link_' . $link_type; // Masonry layout if ( isset( $masonry ) AND $masonry == 'true' ) { $classes .= ' type_masonry'; if ( $columns > 1 AND us_get_option( 'ajax_load_js', FALSE ) == FALSE ) { wp_enqueue_script( 'us-isotope' ); } } // With titles $with_titles = FALSE; if ( isset( $meta ) AND $meta == 'true' ) { $with_titles = TRUE; $classes .= ' with_meta'; } // With indents if ( isset( $indents ) AND $indents == 'true' ) { $classes .= ' with_indents'; } // Filter classes $classes = apply_filters( 'us_gallery_listing_classes', $classes ); // Get images $query_args = array( 'include' => $ids, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'post__in', ); if ( $orderby == 'rand' ) { $query_args['orderby'] = 'rand'; } $attachments = get_posts( $query_args ); if ( ! is_array( $attachments ) OR empty( $attachments ) ) { return; } // Gallery shortcode usage in feeds if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $attachment ) { $output .= wp_get_attachment_link( $attachment->ID, 'thumbnail', TRUE ) . "\n"; } return $output; } // Output the element $output = '<div class="w-gallery' . $classes . '"><div class="w-gallery-list">'; $item_tag_name = ( $link_type == 'none' ) ? 'div' : 'a'; foreach ( $attachments as $index => $attachment ) { // Use the Caption as title $title = trim( strip_tags( $attachment->post_excerpt ) ); if ( empty( $title ) ) { // If no Caption, use the Alt $title = trim( strip_tags( get_post_meta( $attachment->ID, '_wp_attachment_image_alt', TRUE ) ) ); } if ( empty( $title ) ) { // If no Alt, use the Title $title = trim( strip_tags( $attachment->post_title ) ); } $output .= '<' . $item_tag_name . ' class="w-gallery-item order_' . ( $index + 1 ); $output .= apply_filters( 'us_gallery_listing_item_classes', '' ); $output .= '"'; if ( $link_type == 'file' ) { $output .= ' href="' . wp_get_attachment_url( $attachment->ID ) . '" title="' . esc_attr( $title ) . '"'; } elseif ( $link_type == 'attachment' ) { $output .= ' href="' . get_attachment_link( $attachment->ID ) . '" title="' . esc_attr( $title ) . '"'; } $output .= '>'; $output .= '<div class="w-gallery-item-img">'; $output .= us_get_attachment_image( $attachment->ID, $size ); $output .= '</div>'; if ( $with_titles ) { $output .= '<div class="w-gallery-item-meta">'; if ( $title != '' ) { $output .= '<div class="w-gallery-item-title">' . $title . '</div>'; } $output .= ( ! empty( $attachment->post_content ) ) ? '<div class="w-gallery-item-description">' . $attachment->post_content . '</div>' : ''; $output .= '</div>'; } $output .= '</' . $item_tag_name . '>'; } $output .= "</div></div>"; echo $output;
[+]
..
[-] person.php
[edit]
[-] separator.php
[edit]
[-] post_custom_field.php
[edit]
[-] post_image.php
[edit]
[-] page_block.php
[edit]
[-] image_slider.php
[edit]
[-] cform.php
[edit]
[-] progbar.php
[edit]
[-] btn.php
[edit]
[-] product_field.php
[edit]
[-] socials.php
[edit]
[-] cta.php
[edit]
[-] message.php
[edit]
[-] vc_wp_custommenu.php
[edit]
[-] contacts.php
[edit]
[-] post_taxonomy.php
[edit]
[-] flipbox.php
[edit]
[-] grid.php
[edit]
[-] post_comments.php
[edit]
[-] gallery.php
[edit]
[-] sharing.php
[edit]
[-] post_date.php
[edit]
[-] product_ordering.php
[edit]
[-] post_navigation.php
[edit]
[-] add_to_cart.php
[edit]
[-] product_gallery.php
[edit]
[-] gmaps.php
[edit]
[-] vc_tta_tabs.php
[edit]
[-] breadcrumbs.php
[edit]
[-] page_title.php
[edit]
[-] counter.php
[edit]
[-] vc_video.php
[edit]
[-] cart.php
[edit]
[-] post_content.php
[edit]
[-] image.php
[edit]
[-] vc_row_inner.php
[edit]
[-] dropdown.php
[edit]
[-] iconbox.php
[edit]
[-] vc_column.php
[edit]
[-] post_title.php
[edit]
[-] hwrapper.php
[edit]
[-] .elements.php
[edit]
[-] vc_column_text.php
[edit]
[-] additional_menu.php
[edit]
[-] vc_tta_section.php
[edit]
[-] popup.php
[edit]
[-] scroller.php
[edit]
[-] menu.php
[edit]
[-] pricing.php
[edit]
[-] search.php
[edit]
[-] text.php
[edit]
[-] post_author.php
[edit]
[-] vc_row.php
[edit]
[-] itext.php
[edit]
[-] html.php
[edit]