protected function shortcode_html() { $dt_query = $this->get_albums_attachments(array('orderby' => $this->atts['orderby'], 'order' => $this->atts['order'], 'number' => $this->atts['number'], 'select' => $this->atts['select'], 'category' => $this->atts['category'])); $output = ''; if ($dt_query->have_posts()) { $this->backup_post_object(); $this->backup_theme_config(); $this->setup_config(); ob_start(); do_action('presscore_before_shortcode_loop', $this->shortcode_name, $this->atts); // 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, $this->atts); $output = ob_get_contents(); ob_end_clean(); $this->restore_theme_config(); $this->restore_post_object(); } return $output; }
protected function albums_jsgrid(&$attributes) { $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-albums-shortcode')) . presscore_masonry_container_data_atts() . '>'; while ($dt_query->have_posts()) { $dt_query->the_post(); presscore_populate_album_post_config(); dt_get_template_part('albums/masonry/albums-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; }
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) { $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; }
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; }
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 portfolio_slider() { $output = ''; // query $dt_query = $this->get_posts_by_terms(array('orderby' => $this->atts['orderby'], 'order' => $this->atts['order'], 'number' => $this->atts['number'], 'select' => $this->atts['select'], 'category' => $this->atts['category'])); if ($dt_query->have_posts()) { // setup $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">'; presscore_populate_portfolio_config(); presscore_get_config()->set('post.preview.media.style', 'featured_image'); dt_get_template_part('portfolio/masonry/portfolio-masonry-post'); echo '</li>'; } // store loop html $posts_html = ob_get_contents(); ob_end_clean(); // shape output $output = '<div ' . $this->get_container_html_class(array('dt-portfolio-shortcode', 'slider-wrapper')) . ' ' . $this->get_container_data_atts() . '>'; $output .= '<div class="frame fullwidth-slider"><ul class="clearfix">' . $posts_html . '</ul></div>'; if ($this->atts['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; }
private function blog_masonry() { $output = ''; $dt_query = $this->get_posts_by_terms(array('orderby' => $this->atts['orderby'], 'order' => $this->atts['order'], 'number' => $this->atts['number'], 'select' => $this->atts['select'], 'category' => $this->atts['category'])); if ($dt_query->have_posts()) { $this->backup_post_object(); $this->backup_theme_config(); $this->setup_config(); ob_start(); do_action('presscore_before_shortcode_loop', $this->shortcode_name, $this->atts); // fullwidth wrap open if ($this->atts['full_width']) { echo '<div class="full-width-wrap">'; } // masonry container open echo '<div ' . presscore_masonry_container_class(array('wf-container', 'dt-blog-shortcode')) . presscore_masonry_container_data_atts() . '>'; while ($dt_query->have_posts()) { $dt_query->the_post(); presscore_populate_post_config(); $this->config->set('post.preview.gallery.style', 'hovered_gallery'); dt_get_template_part('blog/masonry/blog-masonry-post'); } // masonry container close echo '</div>'; // fullwidth wrap close if ($this->atts['full_width']) { echo '</div>'; } do_action('presscore_after_shortcode_loop', $this->shortcode_name, $this->atts); $output = ob_get_contents(); ob_end_clean(); // cleanup $this->restore_theme_config(); $this->restore_post_object(); } return $output; }
public function slider() { $output = ''; $attributes =& $this->atts; // query $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()) { // setup $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('blog/masonry/blog-masonry-post'); echo '</li>'; } // store loop html $posts_html = ob_get_contents(); ob_end_clean(); // cleanup $this->remove_hooks(); $this->restore_theme_config(); $this->restore_post_object(); // shape output $output = '<div ' . $this->get_container_html_class(array('dt-blog-shortcode', 'slider-wrapper')) . ' ' . $this->get_container_data_atts() . '>'; $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>'; } return $output; }
/////////////////////// presscore_display_posts_filter(array('post_type' => 'post', 'taxonomy' => 'category')); echo '<div ' . presscore_list_container_html_class('articles-list') . presscore_list_container_data_atts() . '>'; ////////////////////// // Custom loop // ////////////////////// $page_query = presscore_get_blog_query(); // start loop if ($page_query->have_posts()) { while ($page_query->have_posts()) { $page_query->the_post(); // global posts counter $config->set('post.query.var.current_post', $page_query->current_post + 1); // populate config with current post settings presscore_populate_post_config(); dt_get_template_part('blog/list/blog-list-post'); } wp_reset_postdata(); } echo '</div>'; ///////////////////// // Pagination // ///////////////////// presscore_complex_pagination($page_query); // restore config $config->reset($config_backup); } do_action('presscore_after_loop'); } } // main loop
} $config = Presscore_Config::get_instance(); ?> <div class="rollover-project links-hovers-disabled"> <?php dt_get_template_part('albums/masonry/albums-masonry-post-rollover-media'); ?> <?php if ($config->get('post.preview.content.visible')) { ?> <div class="rollover-content"> <?php if ('on_hoover_centered' == $config->get('post.preview.description.style')) { dt_get_template_part('albums/masonry/albums-masonry-post-rollover-content-centered'); } else { dt_get_template_part('albums/masonry/albums-masonry-post-rollover-content'); } ?> </div> <?php } ?> </div>
?> <?php if (!post_password_required()) { ?> <?php $media_layout = get_post_meta($post->ID, '_dt_project_media_options_layout', true); // layout switch ($media_layout) { case 'before': case 'after': dt_get_template_part('portfolio-post-v'); break; default: dt_get_template_part('portfolio-post-h'); } ?> <?php } else { ?> <?php the_content(); ?> <?php } ?>
// fullwidth wrap open if ($config->get('full_width')) { echo '<div class="full-width-wrap">'; } // masonry container open echo '<div ' . presscore_masonry_container_class(array('wf-container')) . presscore_masonry_container_data_atts() . '>'; ////////////////////// // Custom loop // ////////////////////// $page_query = Presscore_Inc_Team_Post_Type::get_template_query(); if ($page_query->have_posts()) { while ($page_query->have_posts()) { $page_query->the_post(); // populate config presscore_populate_team_config(); dt_get_template_part('team/team-post'); } wp_reset_postdata(); } // masonry container close echo '</div>'; // fullwidth wrap close if ($config->get('full_width')) { echo '</div>'; } ///////////////////// // Pagination // ///////////////////// dt_paginator($page_query); } do_action('presscore_after_loop');
protected function render_teammate($instance = array()) { echo '<div class="team-container' . (!$instance['show_excerpt'] ? ' description-off' : '') . '">'; dt_get_template_part('team/team-post-media'); echo '<div class="team-desc">'; dt_get_template_part('team/team-post-content'); echo '</div>'; echo '</div>'; }
* * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } ?> <div class="blog-content wf-td" <?php echo presscore_get_post_content_style_for_blog_list('content'); ?> > <?php dt_get_template_part('blog/blog-post-content-part', get_post_format()); ?> <?php $config = Presscore_Config::get_instance(); if ($config->get('show_details')) { echo presscore_post_details_link(); } ?> <?php echo presscore_new_posted_on('post'); ?> <?php echo presscore_post_edit_link();
if ($config->get('full_width')) { echo '<div class="full-width-wrap">'; } // masonry container open echo '<div ' . presscore_masonry_container_class(array('wf-container')) . presscore_masonry_container_data_atts() . '>'; ////////////////////// // Custom loop // ////////////////////// if ($page_query->have_posts()) { add_filter('presscore_get_images_gallery_hoovered-title_img_args', 'presscore_gallery_post_exclude_featured_image_from_gallery', 15, 3); while ($page_query->have_posts()) { $page_query->the_post(); // populate post config presscore_populate_album_post_config(); // get_template_part( 'content', 'gallery' ); dt_get_template_part('albums/masonry/albums-masonry-post'); } wp_reset_postdata(); remove_filter('presscore_get_images_gallery_hoovered-title_img_args', 'presscore_gallery_post_exclude_featured_image_from_gallery', 15, 3); } // masonry container close echo '</div>'; // fullwidth wrap close if ($config->get('full_width')) { echo '</div>'; } ///////////////////// // Pagination // ///////////////////// presscore_complex_pagination($page_query); // restore config
<?php /** * Portfolio post content part with rollover * * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } ?> <div class="wf-table"> <div class="wf-td"> <?php dt_get_template_part('media/media-masonry-post-rollover-content'); ?> </div> </div>
* */ // File Security Check if (!defined('ABSPATH')) { exit; } ?> <?php do_action('presscore_before_post'); ?> <article id="post-<?php the_ID(); ?> " <?php post_class('post'); ?> > <?php dt_get_template_part('blog/masonry/blog-masonry-post-content'); ?> </article><!-- #post-<?php the_ID(); ?> --> <?php do_action('presscore_after_post');
<?php /** * Blog post content media template * * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } // check show or not media content if (presscore_show_post_media()) { echo '<div class="blog-media wf-td">'; ///////////////// // fancy date // ///////////////// echo presscore_get_blog_post_fancy_date(); ///////////////////// // media template // ///////////////////// dt_get_template_part("blog/masonry/blog-masonry-post-media-content", get_post_format()); echo '</div>'; }
protected function post_template() { presscore_populate_portfolio_config(); dt_get_template_part('portfolio/masonry/portfolio-masonry-post'); }
if ($show_sidebar) { // footer layout $sidebar_layout = presscore_get_sidebar_layout_parser($config->get('template.footer.layout')); $sidebar_layout->add_sidebar_columns(); ?> <div class="wf-wrap"> <div class="wf-container-footer"> <div class="wf-container"> <?php do_action('presscore_before_footer_widgets'); dynamic_sidebar($footer_sidebar); ?> </div><!-- .wf-container --> </div><!-- .wf-container-footer --> </div><!-- .wf-wrap --> <?php $sidebar_layout->remove_sidebar_columns(); } if ($show_bottom_bar) { dt_get_template_part('footer/bottom-bar'); } ?> </footer><!-- #footer --> <?php }
<?php /** * Portfolio post content part with rollover * * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } ?> <div class="rollover-content-container"> <?php dt_get_template_part('media/media-masonry-post-rollover-content-part-description'); ?> </div>
/** * Get media posts in masonry layout. * */ public static function get_media_masonry_content($ajax_data = array()) { global $post, $wp_query, $paged, $page; extract($ajax_data); if (!$nonce || !$post_id || !$post_paged || !$target_page || !wp_verify_nonce($nonce, 'presscore-posts-ajax')) { $responce = array('success' => false, 'reason' => 'corrupted data'); } else { /** * Include AQResizer. * */ require_once PRESSCORE_EXTENSIONS_DIR . '/aq_resizer.php'; /** * Include helpers. * */ require_once PRESSCORE_DIR . '/helpers.php'; /** * Include template actions and filters. * */ require_once PRESSCORE_DIR . '/template-hooks.php'; /** * Include paginator. * */ require_once PRESSCORE_EXTENSIONS_DIR . '/dt-pagination.php'; if (!class_exists('Mobile_Detect')) { /** * Mobile detection library. * */ require_once PRESSCORE_EXTENSIONS_DIR . '/mobile-detect.php'; } // get page query_posts(array('post_type' => 'page', 'page_id' => $post_id, 'post_status' => 'publish', 'page' => $target_page)); $html = ''; $responce = array('success' => true); if (have_posts() && !post_password_required()) { while (have_posts()) { the_post(); // main loop $config = Presscore_Config::get_instance(); $config->set('template', 'media'); presscore_config_base_init($post_id); if ($config->get('justified_grid') && isset($sender) && in_array($sender, array('filter', 'paginator'))) { $loaded_items = array(); } ob_start(); do_action('presscore_before_loop'); $page_query = Presscore_Inc_Albums_Post_Type::get_media_template_query(); if ($page_query->have_posts()) { while ($page_query->have_posts()) { $page_query->the_post(); $key_in_loaded = array_search($post->ID, $loaded_items); if (false !== $key_in_loaded) { unset($loaded_items[$key_in_loaded]); continue; } dt_get_template_part('media/media-masonry-post'); } wp_reset_postdata(); } $html .= ob_get_clean(); } $next_page_link = dt_get_next_posts_url($page_query->max_num_pages); if ($next_page_link) { $responce['nextPage'] = dt_get_paged_var() + 1; } else { $responce['nextPage'] = 0; } $load_style = $config->get('load_style'); // pagination style if (presscore_is_load_more_pagination()) { $pagination = dt_get_next_page_button($page_query->max_num_pages, 'paginator paginator-more-button with-ajax'); if ($pagination) { $responce['currentPage'] = dt_get_paged_var(); $responce['paginationHtml'] = $pagination; } else { $responce['currentPage'] = $post_paged; } $responce['paginationType'] = 'more'; } else { if ('ajax_pagination' == $load_style) { ob_start(); dt_paginator($page_query, array('class' => 'paginator with-ajax', 'ajaxing' => true)); $pagination = ob_get_clean(); if ($pagination) { $responce['paginationHtml'] = $pagination; } $responce['paginationType'] = 'paginator'; } } $responce['itemsToDelete'] = array_values($loaded_items); // $responce['query'] = $page_query->query; $responce['order'] = strtolower($config->get('order')); $responce['orderby'] = strtolower($config->get('orderby')); } // main loop $responce['html'] = $html; } $responce = json_encode($responce); // responce output header("Content-Type: application/json"); echo $responce; // IMPORTANT: don't forget to "exit" exit; }
exit; } global $post; $config = Presscore_Config::get_instance(); ?> <article id="post-<?php the_ID(); ?> " <?php post_class('project-post'); ?> > <?php do_action('presscore_before_post_content'); if (!post_password_required()) { dt_get_template_part('portfolio/portfolio-post-single-content'); } else { the_content(); } do_action('presscore_after_post_content'); ?> </article><!-- #post-<?php the_ID(); ?> --> <?php presscore_display_related_projects();
/** * Get portfolio posts in masonry layout. * */ public static function get_masonry_content($ajax_data = array()) { global $post, $wp_query, $paged, $page; extract($ajax_data); if (!$nonce || !$post_id || !$post_paged || !$target_page || !wp_verify_nonce($nonce, 'presscore-posts-ajax')) { $responce = array('success' => false, 'reason' => 'corrupted data'); } else { /** * Include AQResizer. * */ require_once PRESSCORE_EXTENSIONS_DIR . '/aq_resizer.php'; /** * Include helpers. * */ require_once PRESSCORE_DIR . '/helpers.php'; /** * Include template actions and filters. * */ require_once PRESSCORE_DIR . '/template-tags.php'; /** * Include paginator. * */ require_once PRESSCORE_EXTENSIONS_DIR . '/dt-pagination.php'; if (!class_exists('Mobile_Detect')) { /** * Mobile detection library. * */ require_once PRESSCORE_EXTENSIONS_DIR . '/mobile-detect.php'; } // get page query_posts(array('post_type' => 'page', 'page_id' => $post_id, 'post_status' => 'publish', 'page' => $target_page)); $config = Presscore_Config::get_instance(); $config->set('template', 'portfolio'); $config->base_init($post_id); if ($config->get('justified_grid') && isset($sender) && in_array($sender, array('filter', 'paginator'))) { $loaded_items = array(); } presscore_react_on_categorizer(); $html = ''; $responce = array('success' => true); if (have_posts() && !post_password_required()) { while (have_posts()) { the_post(); // main loop ob_start(); presscore_portfolio_meta_new_controller(); do_action('presscore_before_loop'); $ppp = $config->get('posts_per_page'); $order = $config->get('order'); $orderby = $config->get('orderby'); $display = $config->get('display'); $request_display = $config->get('request_display'); // $layout = 'masonry'; $all_terms = get_categories(array('type' => 'dt_portfolio', 'hide_empty' => 1, 'hierarchical' => 0, 'taxonomy' => 'dt_portfolio_category', 'pad_counts' => false)); $all_terms_array = array(); foreach ($all_terms as $term) { $all_terms_array[] = $term->term_id; } $page_args = array('post_type' => 'dt_portfolio', 'post_status' => 'publish', 'paged' => dt_get_paged_var(), 'order' => $order, 'orderby' => 'name' == $orderby ? 'title' : $orderby); if ($ppp) { $page_args['posts_per_page'] = intval($ppp); } if ('all' != $display['select'] && !empty($display['terms_ids'])) { $page_args['tax_query'] = array(array('taxonomy' => 'dt_portfolio_category', 'field' => 'term_id', 'terms' => array_values($display['terms_ids']), 'operator' => 'IN')); if ('except' == $display['select']) { $terms_arr = array_diff($all_terms_array, $display['terms_ids']); sort($terms_arr); if ($terms_arr) { $page_args['tax_query']['relation'] = 'OR'; $page_args['tax_query'][1] = $page_args['tax_query'][0]; $page_args['tax_query'][0]['terms'] = $terms_arr; $page_args['tax_query'][1]['operator'] = 'NOT IN'; } add_filter('posts_clauses', 'dt_core_join_left_filter'); } } // filter if ($request_display) { // except if (0 == current($request_display['terms_ids'])) { // ninjaaaa $request_display['terms_ids'] = $all_terms_array; } $page_args['tax_query'] = array(array('taxonomy' => 'dt_portfolio_category', 'field' => 'term_id', 'terms' => array_values($request_display['terms_ids']), 'operator' => 'IN')); if ('except' == $request_display['select']) { $page_args['tax_query'][0]['operator'] = 'NOT IN'; } } $page_query = new WP_Query($page_args); remove_filter('posts_clauses', 'dt_core_join_left_filter'); if ($page_query->have_posts()) { while ($page_query->have_posts()) { $page_query->the_post(); $key_in_loaded = array_search($post->ID, $loaded_items); if (false !== $key_in_loaded) { unset($loaded_items[$key_in_loaded]); continue; } dt_get_template_part('portfolio-masonry-content'); } wp_reset_postdata(); } $html .= ob_get_clean(); } $next_page_link = dt_get_next_posts_url($page_query->max_num_pages); if ($next_page_link) { $responce['nextPage'] = dt_get_paged_var() + 1; } else { $responce['nextPage'] = 0; } $load_style = $config->get('load_style'); // pagination style if (presscore_is_load_more_pagination()) { $pagination = dt_get_next_page_button($page_query->max_num_pages, 'paginator paginator-more-button with-ajax'); if ($pagination) { $responce['currentPage'] = dt_get_paged_var(); $responce['paginationHtml'] = $pagination; } else { $responce['currentPage'] = $post_paged; } $responce['paginationType'] = 'more'; } else { if ('ajax_pagination' == $load_style) { ob_start(); dt_paginator($page_query, array('class' => 'paginator with-ajax', 'ajaxing' => true)); $pagination = ob_get_clean(); if ($pagination) { $responce['paginationHtml'] = $pagination; } $responce['paginationType'] = 'paginator'; } } $responce['itemsToDelete'] = array_values($loaded_items); // $responce['query'] = $page_query->query; $responce['order'] = $page_query->query['order']; $responce['orderby'] = $page_query->query['orderby']; } // main loop $responce['html'] = $html; } return $responce; }
dt_get_template_part('portfolio/masonry/portfolio-masonry-post'); // restore config $config->reset($config_backup); break; case 'dt_gallery': add_filter('presscore_get_images_gallery_hoovered-title_img_args', 'presscore_gallery_post_exclude_featured_image_from_gallery', 15, 3); // populate post config presscore_populate_album_post_config(); // get_template_part( 'content', 'gallery' ); dt_get_template_part('albums/masonry/albums-masonry-post'); remove_filter('presscore_get_images_gallery_hoovered-title_img_args', 'presscore_gallery_post_exclude_featured_image_from_gallery', 15, 3); // restore config $config->reset($config_backup); break; default: dt_get_template_part('content-archive'); break; } } // masonry container close echo '</div>'; dt_paginator(); // restore config $config->reset($config_backup); do_action('presscore_after_loop'); } else { get_template_part('no-results', 'search'); } ?> </div><!-- #content -->
<article <?php post_class(array('project-' . $article_content_layout)); ?> > <?php $post_format = get_post_format(); if ('odd' == $article_content_layout || 'wide' == $config->get('post.preview.width')) { // media if (presscore_post_format_supports_media_content($post_format)) { dt_get_template_part('blog/list/blog-list-post-media', $post_format); } // content dt_get_template_part('blog/list/blog-list-post-content', $post_format); } else { // content dt_get_template_part('blog/list/blog-list-post-content', $post_format); // media if (presscore_post_format_supports_media_content($post_format)) { dt_get_template_part('blog/list/blog-list-post-media', $post_format); } } ?> </article><!-- #post-<?php the_ID(); ?> --> <?php do_action('presscore_after_post');
<div class="<?php echo esc_attr($masonry_container_classes); ?> "<?php echo $masonry_container_data_attr; ?> > <?php if ($page_query->have_posts()) { while ($page_query->have_posts()) { $page_query->the_post(); ?> <?php dt_get_template_part('portfolio-masonry-content'); ?> <?php } wp_reset_postdata(); } ?> </div> <?php if ($full_width) { ?> </div>
<?php do_action('presscore_before_post'); ?> <article <?php post_class(array('post', 'project-' . $article_content_layout)); ?> > <?php if ('odd' == $article_content_layout || 'wide' == $config->get('post.preview.width')) { // media dt_get_template_part('portfolio/list/portfolio-list-post-media'); // content dt_get_template_part('portfolio/list/portfolio-list-post-content'); } else { // content dt_get_template_part('portfolio/list/portfolio-list-post-content'); // media dt_get_template_part('portfolio/list/portfolio-list-post-media'); } ?> </article><!-- #post-<?php the_ID(); ?> --> <?php do_action('presscore_after_post');
protected function post_template() { presscore_populate_post_config(); $this->config->set('post.preview.gallery.style', 'hovered_gallery'); dt_get_template_part('blog/masonry/blog-masonry-post'); }