Пример #1
0
 function gdlr_get_modern_room($query, $size, $thumbnail_size)
 {
     $current_size = 0;
     $ret = '';
     while ($query->have_posts()) {
         $query->the_post();
         $post_option = json_decode(gdlr_decode_preventslashes(get_post_meta(get_the_ID(), 'post-option', true)), true);
         if ($current_size % $size == 0) {
             $ret .= '<div class="clear"></div>';
         }
         $ret .= '<div class="' . gdlr_get_column_class('1/' . $size) . '">';
         $ret .= '<div class="gdlr-item gdlr-room-item gdlr-modern-room">';
         $ret .= '<div class="gdlr-ux gdlr-modern-room-ux">';
         $ret .= '<div class="gdlr-room-thumbnail">' . gdlr_get_room_thumbnail($post_option, $thumbnail_size) . '</div>';
         $ret .= '<h3 class="gdlr-room-title"><a href="' . get_permalink() . '" >' . get_the_title() . '</a></h3>';
         $ret .= '<a href="' . get_permalink() . '" class="gdlr-room-detail">' . __('Check Details', 'gdlr-hotel') . '<i class="fa fa-long-arrow-right icon-long-arrow-right"></i></a>';
         $ret .= '</div>';
         // gdlr-ux
         $ret .= '</div>';
         // gdlr-item
         $ret .= '</div>';
         // gdlr-column-class
         $current_size++;
     }
     wp_reset_postdata();
     return $ret;
 }
 function gdlr_get_modern_portfolio($query, $size, $thumbnail_size, $layout = 'fitRows')
 {
     if ($layout == 'carousel') {
         return gdlr_get_modern_carousel_portfolio($query, $size, $thumbnail_size);
     }
     global $post;
     $current_size = 0;
     $ret = '<div class="gdlr-isotope" data-type="portfolio" data-layout="' . $layout . '" >';
     while ($query->have_posts()) {
         $query->the_post();
         if ($current_size % $size == 0) {
             $ret .= '<div class="clear"></div>';
         }
         $ret .= '<div class="' . gdlr_get_column_class('1/' . $size) . '">';
         $ret .= '<div class="gdlr-item gdlr-portfolio-item gdlr-modern-portfolio">';
         $ret .= '<div class="gdlr-ux gdlr-modern-portfolio-ux">';
         $port_option = json_decode(gdlr_decode_preventslashes(get_post_meta($post->ID, 'post-option', true)), true);
         $ret .= '<div class="portfolio-thumbnail ' . gdlr_get_portfolio_thumbnail_class($port_option) . '">';
         $ret .= gdlr_get_portfolio_thumbnail($port_option, $thumbnail_size, true);
         $ret .= '</div>';
         // portfolio-thumbnail
         $ret .= '</div>';
         // gdlr-ux
         $ret .= '</div>';
         // gdlr-item
         $ret .= '</div>';
         // gdlr-column-class
         $current_size++;
     }
     $ret .= '</div>';
     wp_reset_postdata();
     return $ret;
 }
Пример #3
0
 function gdlr_get_gallery_thumbnail($settings)
 {
     $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
     global $gdlr_spaces;
     $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
     $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
     $ret = '<div class="gdlr-gallery-item gdlr-item gdlr-gallery-thumbnail" ' . $item_id . $margin_style . '>';
     // full image
     $ret .= '<div class="gdlr-gallery-thumbnail-container">';
     foreach ($settings['slider'] as $slide_id => $slide) {
         $ret .= '<div class="gdlr-gallery-thumbnail" data-id="' . $slide_id . '" >';
         $ret .= gdlr_get_image($slide_id);
         if ($settings['show-caption'] != 'no') {
             $ret .= '<div class="gallery-caption-wrapper">';
             $ret .= '<span class="gallery-caption">';
             $ret .= gdlr_get_attachment_info($slide_id, 'caption');
             $ret .= '</span>';
             $ret .= '</div>';
         }
         $ret .= '</div>';
     }
     $ret .= '</div>';
     // start printing gallery
     $current_size = 0;
     foreach ($settings['slider'] as $slide_id => $slide) {
         if (!empty($current_size) && $current_size % $settings['gallery-columns'] == 0) {
             $ret .= '<div class="clear"></div>';
         }
         $ret .= '<div class="gallery-column ' . gdlr_get_column_class('1/' . $settings['gallery-columns']) . '">';
         $ret .= '<div class="gallery-item" data-id="' . $slide_id . '" >';
         $ret .= gdlr_get_image($slide_id, $settings['thumbnail-size']);
         $ret .= '</div>';
         // gallery item
         $ret .= '</div>';
         // gallery column
         $current_size++;
     }
     $ret .= '<div class="clear"></div>';
     $ret .= '</div>';
     // gdlr-gallery-item
     return $ret;
 }
Пример #4
0
 function gdlr_get_modern_page_list($query, $size, $thumbnail_size, $layout = 'fitRows')
 {
     $current_size = 0;
     $ret = '<div class="gdlr-isotope" data-type="portfolio" data-layout="' . $layout . '" >';
     while ($query->have_posts()) {
         $query->the_post();
         if ($current_size % $size == 0) {
             $ret .= '<div class="clear"></div>';
         }
         $ret .= '<div class="' . gdlr_get_column_class('1/' . $size) . '">';
         $ret .= '<div class="gdlr-item gdlr-portfolio-item gdlr-modern-portfolio">';
         // overlay
         $ret .= '<div class="portfolio-thumbnail gdlr-image">';
         $ret .= gdlr_get_image(get_post_thumbnail_id(), $thumbnail_size);
         $ret .= '<a class="portfolio-overlay-wrapper" href="' . get_permalink() . '" >';
         $ret .= '<span class="portfolio-overlay" >';
         $ret .= '<span class="portfolio-icon" ><i class="icon-link" ></i></span>';
         $ret .= '</span>';
         $ret .= '<div class="portfolio-thumbnail-bar"></div>';
         $ret .= '</a>';
         // content
         $ret .= '<div class="portfolio-content-wrapper">';
         $ret .= '<div class="portfolio-content-overlay"></div>';
         $ret .= '<h3 class="portfolio-title"><a href="' . get_permalink() . '" >' . get_the_title() . '</a></h3>';
         $ret .= '</div>';
         // portfolio-content-wrapper
         $ret .= '</div>';
         // portfolio-thumbnail
         $ret .= '</div>';
         // gdlr-item
         $ret .= '</div>';
         // column class
         $current_size++;
     }
     $ret .= '</div>';
     wp_reset_postdata();
     return $ret;
 }
 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $indent = $depth ? str_repeat("\t", $depth) : '';
     $class_names = $value = $data_column = $data_size = '';
     $classes = empty($item->classes) ? array() : (array) $item->classes;
     $classes[] = 'menu-item-' . $item->ID;
     $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));
     if ($depth == 0) {
         $class_names .= empty($item->gdlr_mega_menu) ? $class_names . ' gdlr-normal-menu' : $class_names . ' gdlr-mega-menu';
     } else {
         if ($depth == 1 && get_post_meta($item->menu_item_parent, '_gdlr_mega_menu_item', true) == 'mega_menu') {
             $data_size .= ' data-size="' . $item->gdlr_mega_section . '"';
             $data_column .= ' data-column="' . gdlr_get_column_class($item->gdlr_mega_section) . '"';
         }
     }
     $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
     $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);
     $id = $id ? ' id="' . esc_attr($id) . '"' : '';
     $output .= $indent . '<li ' . $id . $value . $class_names . $data_column . $data_size . '>';
     $atts = array();
     $atts['title'] = !empty($item->attr_title) ? $item->attr_title : '';
     $atts['target'] = !empty($item->target) ? $item->target : '';
     $atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
     $atts['href'] = !empty($item->url) ? $item->url : '';
     $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args);
     $attributes = '';
     foreach ($atts as $attr => $value) {
         if (!empty($value)) {
             $value = 'href' === $attr ? esc_url($value) : esc_attr($value);
             $attributes .= ' ' . $attr . '="' . $value . '"';
         }
     }
     $item_output = $args->before;
     $item_output .= '<a' . $attributes . '>';
     $item_output .= empty($item->gdlr_menu_icon) ? '' : '<i class="' . $item->gdlr_menu_icon . '"></i>';
     $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
     $item_output .= '</a>';
     $item_output .= $args->after;
     $item_output .= empty($item->gdlr_mega_menu) || $depth != 0 ? '' : '<div class="sf-mega">';
     // gdlr-modify
     $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
 }
function gdlr_column_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('size' => '1/2'), $atts));
    if (function_exists('gdlr_get_column_class')) {
        $ret = '<div class="' . gdlr_get_column_class($size) . '">';
        $ret .= '<div class="gdlr-item gdlr-column-shortcode">';
        $ret .= do_shortcode($content);
        $ret .= '</div>';
        $ret .= '</div>';
        return $ret;
    }
    return '';
}
Пример #7
0
 function gdlr_get_blog_grid($query, $size, $blog_layout = 'fitRows')
 {
     if ($blog_layout == 'carousel') {
         return gdlr_get_blog_grid_carousel($query, $size);
     }
     $ret = '';
     $current_size = 0;
     $ret .= '<div class="gdlr-isotope" data-type="blog" data-layout="' . $blog_layout . '" >';
     while ($query->have_posts()) {
         $query->the_post();
         if ($current_size % $size == 0) {
             $ret .= '<div class="clear"></div>';
         }
         $ret .= '<div class="' . gdlr_get_column_class('1/' . $size) . '">';
         $ret .= '<div class="gdlr-item gdlr-blog-grid">';
         $ret .= '<div class="gdlr-ux gdlr-blog-grid-ux">';
         ob_start();
         get_template_part('single/content');
         $ret .= ob_get_contents();
         ob_end_clean();
         $ret .= '</div>';
         // gdlr-ux
         $ret .= '</div>';
         // gdlr-item
         $ret .= '</div>';
         // column_class
         $current_size++;
     }
     $ret .= '<div class="clear"></div>';
     $ret .= '</div>';
     // close the gdlr-isotope
     wp_reset_postdata();
     return $ret;
 }
 function gdlr_print_column_wrapper($content)
 {
     echo '<div class="' . gdlr_get_column_class($content['size']) . '" >';
     foreach ($content['items'] as $item) {
         gdlr_print_item($item);
     }
     echo '</div>';
     // end of column section
 }
function gdlr_print_ticket_item($settings)
{
    $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
    global $gdlr_spaces;
    $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
    $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
    // query posts section
    $args = array('post_type' => 'ticket', 'suppress_filters' => false);
    $args['posts_per_page'] = empty($settings['num-fetch']) ? '999' : $settings['num-fetch'];
    $args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
    $args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
    $args['paged'] = 1;
    if (!empty($settings['category'])) {
        $args['tax_query'] = array(array('terms' => explode(',', $settings['category']), 'taxonomy' => 'ticket_category', 'field' => 'slug'));
    }
    $query = new WP_Query($args);
    echo gdlr_get_item_title($settings);
    echo '<div class="ticket-item-wrapper" ' . $item_id . $margin_style . ' >';
    echo '<div class="ticket-item-holder">';
    $current_size = 0;
    while ($query->have_posts()) {
        $query->the_post();
        $post_val = gdlr_decode_preventslashes(get_post_meta(get_the_ID(), 'post-option', true));
        $post_options = empty($post_val) ? array() : json_decode($post_val, true);
        if ($current_size % $settings['ticket-size'] == 0) {
            echo '<div class="clear"></div>';
        }
        echo '<div class="' . gdlr_get_column_class('1/' . $settings['ticket-size']) . '">';
        echo '<div class="gdlr-item gdlr-ticket-item">';
        echo '<div class="gdlr-ticket-head">';
        echo '<div class="gdlr-ticket-head-title">' . get_the_title() . '</div>';
        echo '<div class="gdlr-ticket-head-price">' . (empty($post_options['price']) ? __('Free', 'gdlr-conference') : gdlr_ticket_money_format($post_options['price'])) . '</div>';
        if (!empty($post_options['featured-ticket']) && $post_options['featured-ticket'] == 'yes') {
            echo '<div class="gdlr-ticket-head-featured gdlr-info-font">' . __('Featured!', 'gdlr-conference') . '</div>';
        }
        echo '</div>';
        // gdlr-ticket-head
        echo '<div class="gdlr-ticket-content gdlr-info-font">';
        the_content();
        echo '</div>';
        // gdlr-ticket-content
        if (!empty($post_options['button-link'])) {
            echo '<a class="gdlr-ticket-button" href="' . esc_attr($post_options['button-link']) . '">' . __('Book Now', 'gdlr-conference') . '</a>';
        } else {
            if (empty($post_options['price']) && $post_options['price'] == '-1') {
                echo '<a class="gdlr-ticket-button gdlr-sold-out" href="#">' . __('Sold Out', 'gdlr-conference') . '</a>';
            } else {
                global $ticket_id;
                $ticket_id = empty($ticket_id) ? 1 : $ticket_id + 1;
                echo '<div class="gdlr-lightbox-form" id="gdlr-form-' . $ticket_id . '" >' . gdlr_paypal_form() . '</div>';
                echo '<a class="gdlr-ticket-button" href="#gdlr-form-' . $ticket_id . '" data-rel="fancybox" data-fancybox-type="inline" >' . __('Book Now', 'gdlr-conference') . '</a>';
            }
        }
        echo '</div>';
        // gdlr-item
        echo '</div>';
        // gdlr-column-class
        $current_size++;
    }
    wp_reset_postdata();
    echo '<div class="clear"></div>';
    echo '</div>';
    echo '</div>';
    // ticket item wrapper
}
Пример #10
0
 function gdlr_get_cause_grid($query, $size, $thumbnail_size, $layout = 'fitRows', $excerpt)
 {
     if ($layout == 'carousel') {
         return gdlr_get_carousel_cause_grid($query, $size, $thumbnail_size, $excerpt);
     }
     global $post;
     $current_size = 0;
     $ret = '<div class="gdlr-isotope" data-type="causes" data-layout="' . $layout . '" >';
     while ($query->have_posts()) {
         $query->the_post();
         if ($current_size % $size == 0) {
             $ret .= '<div class="clear"></div>';
         }
         $ret .= '<div class="' . gdlr_get_column_class('1/' . $size) . '">';
         $ret .= '<div class="gdlr-item gdlr-cause-item gdlr-cause-grid">';
         $ret .= '<div class="gdlr-ux gdlr-cause-grid-ux">';
         $cause_option = json_decode(gdlr_decode_preventslashes(get_post_meta($post->ID, 'post-option', true)), true);
         $ret .= '<div class="gdlr-cause-thumbnail-wrapper">';
         $ret .= gdlr_get_cause_thumbnail($thumbnail_size);
         $ret .= '</div>';
         // cause-thumbnail
         $ret .= '<div class="cause-content-wrapper">';
         $ret .= '<h3 class="cause-title"><a href="' . get_permalink() . '" >' . get_the_title() . '</a></h3>';
         $ret .= gdlr_cause_donation_amount($cause_option['goal-of-donation'], $cause_option['current-funding']);
         if ($excerpt == '-1') {
             $ret .= '<div class="cause-content">' . gdlr_content_filter(get_the_content()) . '</div>';
         } else {
             if (!empty($excerpt)) {
                 $ret .= '<div class="cause-content">' . get_the_excerpt() . '</div>';
             }
         }
         $ret .= gdlr_cause_donation_button($cause_option);
         $ret .= '</div>';
         $ret .= '</div>';
         // gdlr-ux
         $ret .= '</div>';
         // gdlr-item
         $ret .= '</div>';
         // column class
         $current_size++;
     }
     $ret .= '</div>';
     wp_reset_postdata();
     return $ret;
 }
Пример #11
0
function gdlr_print_modern_player($query, $size, $thumbnail_size, $layout)
{
    if ($layout == 'carousel') {
        return gdlr_print_modern_carousel_player($query, $size, $thumbnail_size);
    }
    $current_size = 0;
    while ($query->have_posts()) {
        $query->the_post();
        if ($current_size % $size == 0) {
            echo '<div class="clear"></div>';
        }
        $player_val = gdlr_lms_decode_preventslashes(get_post_meta(get_the_ID(), 'gdlr-soccer-player-settings', true));
        $player_options = empty($player_val) ? array() : json_decode($player_val, true);
        echo '<div class="' . gdlr_get_column_class('1/' . $size) . '">';
        echo '<div class="gdlr-item gdlr-modern-player">';
        echo gdlr_soccer_get_player_avatar($thumbnail_size);
        echo '<div class="gdlr-modern-player-item-content">';
        echo '<a href="' . get_permalink() . '" >';
        echo '<span class="gdlr-modern-player-item-overlay"></span>';
        echo '<span class="gdlr-modern-player-item-content-inner">';
        echo '<span class="gdlr-soccer-player-squad gdlr-title-font" >' . $player_options['player-info']['squad'] . '</span>';
        echo '<span class="gdlr-soccer-player-title gdlr-title-font">' . get_the_title() . '</span>';
        echo '<span class="gdlr-soccer-player-position">' . $player_options['player-info']['position'] . '</span>';
        echo '</span>';
        // modern-player-item-content-inner
        echo '</a>';
        echo '</div>';
        // modern-player-item-content
        echo '</div>';
        // gdlr-item
        echo '</div>';
        // gdlr-column-class
        $current_size++;
    }
    wp_reset_postdata();
}