Пример #1
0
        protected function testimonials_slider($attributes = array())
        {
            if (presscore_vc_is_inline()) {
                $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
                $dummy = '
					<div class="dt_vc-shortcode_dummy dt_vc-testimonials" style="height: 250px;">
						<h5>Testimonials slider</h5>
						<p class="text-small"><strong>Display categories:</strong> ' . $terms_list . '</p>
					</div>
				';
                return $dummy;
            }
            $output = '';
            $dt_query = $this->get_posts_by_terms($attributes);
            if ($dt_query->have_posts()) {
                $autoslide = $attributes['autoslide'];
                $output .= '<ul class="testimonials slider-content rsCont"' . ($autoslide ? ' data-autoslide="' . $autoslide . '"' : '') . '>' . "\n";
                $this->backup_post_object();
                while ($dt_query->have_posts()) {
                    $dt_query->the_post();
                    $output .= '<li>' . Presscore_Inc_Testimonials_Post_Type::render_testimonial() . '</li>';
                }
                $this->restore_post_object();
                $output .= '</ul>' . "\n";
                $output = '<section class="testimonial-item testimonial-item-slider">' . $output . '</section>';
            }
            return $output;
        }
Пример #2
0
 public function shortcode($atts, $content = null)
 {
     $attributes = $this->sanitize_attributes($atts);
     // vc inline dummy
     if (presscore_vc_is_inline()) {
         $terms_title = _x('Display categories', 'vc inline dummy', LANGUAGE_ZONE);
         $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
         return $this->vc_inline_dummy(array('class' => 'dt_vc-photos_masonry', 'title' => _x('Photos masonry', 'vc inline dummy', LANGUAGE_ZONE), 'fields' => array($terms_title => $terms_list)));
     }
     $output = '';
     $dt_query = $this->get_albums_attachments(array('orderby' => $attributes['orderby'], 'order' => $attributes['order'], 'number' => $attributes['number'], 'select' => $attributes['select'], 'category' => $attributes['category']));
     if ($dt_query->have_posts()) {
         $this->backup_post_object();
         $this->backup_theme_config();
         $this->setup_config($attributes);
         ob_start();
         do_action('presscore_before_shortcode_loop', $this->shortcode_name, $attributes);
         // masonry container open
         echo '<div ' . presscore_masonry_container_class(array('wf-container', 'dt-gallery-container', 'dt-photos-shortcode')) . presscore_masonry_container_data_atts() . presscore_get_share_buttons_for_prettyphoto('photo') . '>';
         while ($dt_query->have_posts()) {
             $dt_query->the_post();
             dt_get_template_part('media/media-masonry-post');
         }
         // masonry container close
         echo '</div>';
         do_action('presscore_after_shortcode_loop', $this->shortcode_name, $attributes);
         $output = ob_get_contents();
         ob_end_clean();
         $this->restore_theme_config();
         $this->restore_post_object();
     }
     return $output;
 }
 public function shortcode($atts, $content = null)
 {
     $this->sanitize_attributes($atts);
     // vc inline dummy
     if (presscore_vc_is_inline()) {
         $terms_title = _x('Display categories', 'vc inline dummy', 'the7mk2');
         return $this->vc_inline_dummy(array('class' => 'dt_vc-benefits', 'title' => _x('Benefits', 'vc inline dummy', 'the7mk2'), 'fields' => array($terms_title => presscore_get_terms_list_by_slug(array('slugs' => $this->atts['category'], 'taxonomy' => $this->taxonomy)))));
     }
     if ('dt_benefits' == get_post_type()) {
         return '';
     }
     self::$shortcodes_count++;
     $output = '';
     $dt_query = $this->get_posts_by_terms($this->atts);
     if ($dt_query->have_posts()) {
         $this->backup_post_object();
         $benefits = '';
         while ($dt_query->have_posts()) {
             $dt_query->the_post();
             $benefit_attr = $this->get_benefit_data();
             $benefit_content = apply_filters('the_content', get_the_content(''));
             $benefits .= $this->render_benefit($benefit_attr, $benefit_content);
         }
         $this->restore_post_object();
         $output .= '<section id="' . $this->get_shortcode_id() . '" ' . $this->get_container_html_class('benefits-grid wf-container') . $this->get_conatiner_data_attributes() . '>';
         $output .= $this->get_inline_stylesheet();
         $output .= $benefits;
         $output .= '</section>';
     }
     return $output;
 }
Пример #4
0
        public function shortcode($atts, $content = null)
        {
            $attributes = $this->sanitize_attributes($atts);
            if (presscore_vc_is_inline()) {
                $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
                $dummy = '
					<div class="dt_vc-shortcode_dummy dt_vc-photos_scroller" style="height: ' . $slider_args['height'] . 'px;">
						<h5>Photos scroller</h5>
						<p class="text-small"><strong>Display categories:</strong> ' . $terms_list . '</p>
					</div>
				';
                return $dummy;
            }
            $attachments_ids = array();
            // get albums
            $dt_query = $this->get_posts_by_terms(array_merge($attributes, array('number' => -1)));
            if ($dt_query->have_posts()) {
                // take albums id
                foreach ($dt_query->posts as $dt_post) {
                    $album_attachments = get_post_meta($dt_post->ID, '_dt_album_media_items', true);
                    if ($album_attachments) {
                        $attachments_ids = array_merge($attachments_ids, $album_attachments);
                    }
                }
            }
            if ('rand' == $attributes['orderby']) {
                shuffle($attachments_ids);
            }
            // new query to take attachments
            $attachments_data = presscore_get_attachment_post_data($attachments_ids, 'post__in', 'DESC', $attributes['number']);
            $config = Presscore_Config::get_instance();
            $slider_class = array('shortcode-instagram');
            if ('disabled' == $config->get('sidebar_position')) {
                $slider_class[] = 'full';
            }
            $slider_style = array();
            if ($attributes['margin_bottom']) {
                $slider_style[] = 'margin-bottom: ' . $attributes['margin_bottom'];
            }
            if ($attributes['margin_top']) {
                $slider_style[] = 'margin-top: ' . $attributes['margin_top'];
            }
            $slider_fields = array();
            /*if ( $attributes['arrows'] ) {
            			$slider_fields[] = 'arrows';
            		}*/
            $sharebuttons = presscore_get_share_buttons_for_prettyphoto('photo');
            $slider_args = array('fields' => $slider_fields, 'class' => $slider_class, 'style' => implode(';', $slider_style), 'link' => $attributes['lightbox'] ? 'file' : 'none', 'popup' => $attributes['lightbox'] ? 'gallery' : 'none', 'container_attr' => $sharebuttons);
            /*if ( $attributes['slider_title'] ) {
            			$slider_args['title'] = $attributes['slider_title'];
            		}*/
            if ($attributes['height']) {
                $slider_args['height'] = $attributes['height'];
            }
            if ($attributes['width']) {
                $slider_args['img_width'] = $attributes['width'];
            }
            $output = presscore_get_fullwidth_slider_two($attachments_data, $slider_args);
            return $output;
        }
Пример #5
0
 public function shortcode($atts, $content = null)
 {
     extract(shortcode_atts(array('featured_images' => 'true', 'round_images' => '', 'images_width' => 60, 'images_height' => 60, 'category' => '', 'order' => '', 'orderby' => '', 'number' => 6, 'columns' => 1), $atts));
     // sanitize attributes
     $featured_images = apply_filters('dt_sanitize_flag', $featured_images);
     $round_images = apply_filters('dt_sanitize_flag', $round_images);
     $order = apply_filters('dt_sanitize_order', $order);
     $orderby = apply_filters('dt_sanitize_orderby', $orderby);
     $number = apply_filters('dt_sanitize_posts_per_page', $number);
     $columns = absint($columns);
     $images_width = absint($images_width);
     $images_height = absint($images_height);
     if ($category) {
         $category = explode(',', $category);
         $category = array_map('trim', $category);
     }
     // vc inline dummy
     if (presscore_vc_is_inline()) {
         $terms_title = _x('Display categories', 'vc inline dummy', 'the7mk2');
         $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $category, 'taxonomy' => $this->taxonomy));
         return $this->vc_inline_dummy(array('class' => 'dt_vc-mini_blog', 'title' => _x('Mini blog', 'vc inline dummy', 'the7mk2'), 'fields' => array($terms_title => $terms_list)));
     }
     $related_posts_args = array('exclude_current' => false, 'post_type' => $this->post_type, 'taxonomy' => $this->taxonomy, 'field' => 'slug', 'args' => array('posts_per_page' => $number, 'orderby' => $orderby, 'order' => $order));
     if (!empty($category)) {
         $related_posts_args['cats'] = $category;
         $related_posts_args['select'] = 'only';
     } else {
         $related_posts_args['select'] = 'all';
     }
     $attachments_data = presscore_get_related_posts($related_posts_args);
     $list_args = array('show_images' => $featured_images, 'image_dimensions' => array('w' => $images_width, 'h' => $images_height));
     $posts_list = presscore_get_posts_small_list($attachments_data, $list_args);
     switch ($columns) {
         case 2:
             $column_class = 'wf-1-2';
             break;
         case 3:
             $column_class = 'wf-1-3';
             break;
         case 1:
         default:
             $column_class = 'wf-1';
     }
     $output = '';
     if ($posts_list) {
         foreach ($posts_list as $p) {
             $output .= sprintf('<div class="wf-cell %s"><div class="borders">%s</div></div>', $column_class, $p);
         }
         $section_class = 'items-grid wf-container';
         if ($featured_images && $round_images) {
             $section_class .= ' round-images';
         }
         $output = '<section class="' . $section_class . '">' . $output . '</section>';
     }
     return $output;
 }
Пример #6
0
 public function shortcode($atts, $content = null)
 {
     $attributes = $this->sanitize_attributes($atts);
     // vc inline dummy
     if (presscore_vc_is_inline()) {
         $terms_title = _x('Display categories', 'vc inline dummy', LANGUAGE_ZONE);
         $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
         return $this->vc_inline_dummy(array('class' => 'dt_vc-albums_justified_grid', 'title' => _x('Albums justified grid', 'vc inline dummy', LANGUAGE_ZONE), 'fields' => array($terms_title => $terms_list)));
     }
     return $this->albums_jsgrid($attributes);
 }
 public function shortcode($atts, $content = null)
 {
     $this->atts = $this->sanitize_attributes($atts);
     // vc inline dummy
     if (presscore_vc_is_inline()) {
         $terms_title = _x('Display categories', 'vc inline dummy', 'the7mk2');
         $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $this->atts['category'], 'taxonomy' => $this->taxonomy));
         return $this->vc_inline_dummy(array('class' => 'dt_vc-portfolio_scroller', 'title' => _x('Portfolio scroller', 'vc inline dummy', 'the7mk2'), 'fields' => array($terms_title => $terms_list)));
     }
     return $this->portfolio_slider();
 }
Пример #8
0
        public function shortcode($atts, $content = null)
        {
            $attributes = $this->sanitize_attributes($atts);
            if (presscore_vc_is_inline()) {
                $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => 'dt_team_category'));
                $dummy = '
					<div class="dt_vc-shortcode_dummy dt_vc-team" style="height: 250px;">
						<h5>Team</h5>
						<p class="text-small"><strong>Display categories:</strong> ' . $terms_list . '</p>
					</div>
				';
                return $dummy;
            }
            $output = '';
            $dt_query = $this->get_posts_by_terms($attributes);
            if ($dt_query->have_posts()) {
                $this->backup_post_object();
                $this->backup_theme_config();
                $this->setup_config($attributes);
                ob_start();
                do_action('presscore_before_shortcode_loop', $this->shortcode_name, $attributes);
                if ($attributes['full_width']) {
                    echo '<div class="full-width-wrap">';
                }
                echo '<div ' . presscore_masonry_container_class(array('wf-container')) . presscore_masonry_container_data_atts() . '>';
                while ($dt_query->have_posts()) {
                    $dt_query->the_post();
                    presscore_populate_team_config();
                    dt_get_template_part('team/team-post');
                }
                echo '</div>';
                if ($attributes['full_width']) {
                    echo '</div>';
                }
                do_action('presscore_after_shortcode_loop', $this->shortcode_name, $attributes);
                $output .= ob_get_contents();
                ob_end_clean();
                $this->restore_theme_config();
                $this->restore_post_object();
            }
            return $output;
        }
Пример #9
0
 public function shortcode($atts, $content = null)
 {
     $attributes = $this->sanitize_attributes($atts);
     // vc inline dummy
     if (presscore_vc_is_inline()) {
         $terms_title = _x('Display categories', 'vc inline dummy', LANGUAGE_ZONE);
         $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
         return $this->vc_inline_dummy(array('class' => 'dt_vc-portfolio_jgrid', 'title' => _x('Portfolio justified grid', 'vc inline dummy', LANGUAGE_ZONE), 'fields' => array($terms_title => $terms_list)));
     }
     $output = '';
     $dt_query = $this->get_posts_by_terms(array('orderby' => $attributes['orderby'], 'order' => $attributes['order'], 'number' => $attributes['number'], 'select' => $attributes['select'], 'category' => $attributes['category']));
     if ($dt_query->have_posts()) {
         $this->backup_post_object();
         $this->backup_theme_config();
         $this->setup_config($attributes);
         ob_start();
         do_action('presscore_before_shortcode_loop', $this->shortcode_name, $attributes);
         // fullwidth wrap open
         if ($attributes['full_width']) {
             echo '<div class="full-width-wrap">';
         }
         // masonry container open
         echo '<div ' . presscore_masonry_container_class(array('wf-container', 'dt-portfolio-shortcode')) . presscore_masonry_container_data_atts() . '>';
         while ($dt_query->have_posts()) {
             $dt_query->the_post();
             presscore_populate_portfolio_config();
             dt_get_template_part('portfolio/masonry/portfolio-masonry-post');
         }
         // masonry container close
         echo '</div>';
         // fullwidth wrap close
         if ($attributes['full_width']) {
             echo '</div>';
         }
         do_action('presscore_after_shortcode_loop', $this->shortcode_name, $attributes);
         $output = ob_get_contents();
         ob_end_clean();
         $this->restore_theme_config();
         $this->restore_post_object();
     }
     return $output;
 }
Пример #10
0
 public function shortcode($atts, $content = null)
 {
     $attributes = $this->atts = $this->sanitize_attributes($atts);
     // vc inline dummy
     if (presscore_vc_is_inline()) {
         $terms_title = _x('Display categories', 'vc inline dummy', 'the7mk2');
         $terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
         return $this->vc_inline_dummy(array('class' => 'dt_vc-photos_scroller', 'title' => _x('Photos scroller', 'vc inline dummy', 'the7mk2'), 'fields' => array($terms_title => $terms_list)));
     }
     $output = '';
     $dt_query = $this->get_albums_attachments(array('orderby' => $attributes['orderby'], 'order' => 'DESC', 'number' => $attributes['number'], 'select' => $attributes['select'], 'category' => $attributes['category']));
     if ($dt_query->have_posts()) {
         $this->backup_post_object();
         $this->backup_theme_config();
         $this->setup_config();
         $this->add_hooks();
         ob_start();
         // loop
         while ($dt_query->have_posts()) {
             $dt_query->the_post();
             echo '<li class="fs-entry">';
             dt_get_template_part('media/media-masonry-post');
             echo '</li>';
         }
         $posts_html = ob_get_contents();
         ob_end_clean();
         // shape output
         $output = '<div ' . $this->get_container_html_class(array('dt-photos-shortcode', 'slider-wrapper', 'shortcode-instagram', 'dt-gallery-container')) . ' ' . $this->get_container_data_atts() . presscore_get_share_buttons_for_prettyphoto('photo') . '>';
         $output .= '<div class="frame fullwidth-slider"><ul class="clearfix">' . $posts_html . '</ul></div>';
         if ($attributes['arrows']) {
             $output .= '<div class="prev"><i></i></div><div class="next"><i></i></div>';
         }
         $output .= '</div>';
         // cleanup
         $this->remove_hooks();
         $this->restore_theme_config();
         $this->restore_post_object();
     }
     return $output;
 }
 protected function setup($atts = array(), $content = null)
 {
     $this->config = presscore_get_config();
     $this->vc_is_inline = presscore_vc_is_inline();
     $this->atts = $this->sanitize_attributes($atts);
 }