public function filter_config_for_archives() { if (!(is_archive() || is_search())) { return; } $config = presscore_get_config(); $config->set('show_titles', true); $config->set('show_excerpts', true); $config->set('show_links', true); $config->set('show_details', true); $config->set('show_zoom', true); $config->set('post.meta.fields.date', true); $config->set('post.meta.fields.categories', true); $config->set('post.meta.fields.comments', true); $config->set('post.meta.fields.author', true); $config->set('post.meta.fields.media_number', true); $config->set('post.preview.width.min', 320); $config->set('post.preview.mini_images.enabled', true); $config->set('post.preview.load.effect', 'fade_in'); $config->set('post.preview.background.enabled', true); $config->set('post.preview.background.style', 'fullwidth'); $config->set('post.preview.description.alignment', 'left'); $config->set('post.preview.description.style', 'under_image'); $config->set('post.preview.hover.animation', 'fade'); $config->set('post.preview.hover.color', 'accent'); $config->set('post.preview.hover.content.visibility', 'on_hoover'); $config->set('post.fancy_date.enabled', false); $config->set('template.columns.number', 3); $config->set('load_style', 'default'); $config->set('image_layout', 'original'); $config->set('all_the_same_width', true); $config->set('item_padding', 10); $config->set('layout', 'masonry'); $config->set('template.layout.type', 'masonry'); }
/** * @since 1.0.0 * * @param array $class * @return string */ function presscore_list_container_html_class($custom_class = array()) { $config = presscore_get_config(); $html_class = array(); if ('dark' == $config->get('post.preview.hover.color')) { $html_class[] = 'hover-color-static'; } $html_class[] = presscore_template_loading_effect_html_class($config->get('post.preview.load.effect')); // ajax class if (!in_array($config->get('load_style'), array('default', false))) { $html_class[] = 'with-ajax'; } // lazy loading if ('lazy_loading' == $config->get('load_style')) { $html_class[] = 'lazy-loading-mode'; } ////////////// // Output // ////////////// if ($custom_class && !is_array($custom_class)) { $custom_class = explode(' ', $custom_class); } $html_class = apply_filters('presscore_masonry_container_class', array_merge($custom_class, $html_class)); return $html_class ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($html_class))) : ''; }
function presscore_microsite_setup() { global $post; $config = presscore_get_config(); $config->set('template.beautiful_loading', get_post_meta($post->ID, '_dt_microsite_page_loading', true)); $config->set('template.layout', get_post_meta($post->ID, '_dt_microsite_page_layout', true)); // hide template parts $hidden_parts = get_post_meta($post->ID, "_dt_microsite_hidden_parts", false); // hide header $hide_header = in_array('header', $hidden_parts); $hide_floating_menu = in_array('floating_menu', $hidden_parts); if ($hide_header) { if ($hide_floating_menu) { add_filter('presscore_show_header', '__return_false'); } else { // see template-hooks.php add_filter('presscore_header_classes', 'presscore_microsite_header_classes'); } $config->set('header.layout', 'left'); } // hide bottom bar if (in_array('bottom_bar', $hidden_parts)) { add_filter('presscore_show_bottom_bar', '__return_false'); } // hide content if (in_array('content', $hidden_parts)) { add_filter('presscore_is_content_visible', '__return_false'); } }
/** * Init theme config for shop. * */ function dt_woocommerce_init_template_config($name = '') { dt_woocommerce_add_config_actions(); if ('shop' != $name) { return; } $config = presscore_get_config(); $post_id = null; if (is_shop()) { $post_id = woocommerce_get_page_id('shop'); } else { if (is_cart()) { $post_id = woocommerce_get_page_id('cart'); } else { if (is_checkout()) { $post_id = woocommerce_get_page_id('checkout'); } } } presscore_config_base_init($post_id); if (is_product_category() || is_product_tag()) { $post_id = woocommerce_get_page_id('shop'); if ($post_id) { $config->set('post_id', $post_id); presscore_config_populate_sidebar_and_footer_options(); $config->set('post_id', null); } } if (!is_product()) { add_filter('presscore_get_page_title', 'dt_woocommerce_get_page_title', 20); } // replace theme breadcrumbs add_filter('presscore_get_breadcrumbs-html', 'dt_woocommerce_replace_theme_breadcrumbs', 20, 2); }
/** * Sidebar html classes * * @param array $class Custom html class * @return string Html class attribute */ function presscore_sidebar_html_class($class = array()) { $output = array('sidebar'); $config = presscore_get_config(); switch ($config->get('sidebar.style')) { case 'with_bg': $output[] = 'solid-bg'; break; case 'with_widgets_bg': $output[] = 'bg-under-widget'; break; } ////////////// // Output // ////////////// if ($class && !is_array($class)) { $class = explode(' ', $class); } $output = apply_filters('presscore_sidebar_html_class', array_merge($class, $output)); return $output ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($output))) : ''; }
protected function __construct() { add_shortcode($this->shortcode_name, array($this, 'shortcode')); $this->config = presscore_get_config(); }
public static function get_template_query() { $config = presscore_get_config(); $order = $config->get('order'); $orderby = $config->get('orderby'); $page_args = array('post_type' => self::$post_type, 'post_status' => 'publish', 'paged' => dt_get_paged_var(), 'order' => $order, 'orderby' => 'name' == $orderby ? 'title' : $orderby); $ppp = $config->get('posts_per_page'); if ($ppp) { $page_args['posts_per_page'] = intval($ppp); } // get all dt_portfolio_category terms $all_terms = get_categories(array('type' => self::$post_type, 'hide_empty' => 1, 'hierarchical' => 0, 'taxonomy' => self::$taxonomy, 'pad_counts' => false)); // populate $all_terms_array with terms names $all_terms_array = array(); foreach ($all_terms as $term) { $all_terms_array[] = $term->term_id; } // construct base tax_query if not all terms slected $display = $config->get('display'); if ('all' != $display['select'] && !empty($display['terms_ids']) && is_array($display['terms_ids'])) { // base only tax_query $page_args['tax_query'] = array(array('taxonomy' => self::$taxonomy, 'field' => 'id', 'terms' => array_values($display['terms_ids']), 'operator' => 'IN')); // except tax_query 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'); } } ///////////////// // posts filter // ///////////////// // get filter request $request_display = $config->get('request_display'); if ($request_display) { // except for empty term that appers when all filter category selcted, see it's url if (0 == current($request_display['terms_ids'])) { $request_display['terms_ids'] = $all_terms_array; } // override base tax_query $page_args['tax_query'] = array(array('taxonomy' => 'dt_portfolio_category', 'field' => 'id', 'terms' => array_values($request_display['terms_ids']), 'operator' => 'IN')); if ('except' == $request_display['select']) { $page_args['tax_query'][0]['operator'] = 'NOT IN'; } } ////////////////////// // posts query // ////////////////////// $page_query = new WP_Query($page_args); remove_filter('posts_clauses', 'dt_core_join_left_filter'); return $page_query; }
protected function setup_config(&$attributes) { $config = presscore_get_config(); $config->set('template', 'albums'); $config->set('layout', 'grid'); $config->set('load_style', 'default'); $config->set('justified_grid', true); $config->set('all_the_same_width', true); $config->set('template.layout.type', 'masonry'); $config->set('post.preview.buttons.details.enabled', false); $config->set('post.preview.background.enabled', false); $config->set('post.preview.background.style', false); $config->set('hide_last_row', $attributes['hide_last_row']); $config->set('image_layout', $attributes['proportion'] ? 'resize' : 'original'); $config->set('thumb_proportions', $attributes['proportion']); $config->set('show_titles', $attributes['show_title']); $config->set('show_excerpts', $attributes['show_excerpt']); $config->set('target_height', $attributes['target_height']); $config->set('item_padding', $attributes['padding']); $config->set('post.preview.description.style', $attributes['descriptions']); $config->set('post.preview.description.alignment', $attributes['content_aligment']); $config->set('post.preview.hover.animation', $attributes['hover_animation']); $config->set('post.preview.hover.color', $attributes['hover_bg_color']); $config->set('post.preview.hover.content.visibility', $attributes['hover_content_visibility']); $config->set('post.preview.load.effect', $attributes['loading_effect'], 'fade_in'); $config->set('post.preview.mini_images.enabled', $attributes['show_miniatures']); $config->set('post.meta.fields.media_number', $attributes['show_media_count']); $config->set('post.meta.fields.date', $attributes['show_date']); $config->set('post.meta.fields.categories', $attributes['show_categories']); $config->set('post.meta.fields.comments', $attributes['show_comments']); $config->set('post.meta.fields.author', $attributes['show_author']); }
protected function setup_config($instance = array()) { $config = presscore_get_config(); $config->set('image_layout', 'original'); $config->set('thumb_proportions', array('width' => 0, 'height' => 0)); $config->set('show_excerpts', $instance['show_excerpt']); $config->set('post.preview.width.min', 370); $config->set('template.columns.number', 3); $config->set('post.preview.background.enabled', true); }
<?php /** * Product Loop Start * * @author WooThemes * @package WooCommerce/Templates * @version 2.0.0 */ do_action('dt_wc_loop_start'); do_action('presscore_before_loop'); // fullwidth wrap open if (presscore_get_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() . '>';
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); }
public function shortcode($atts, $content = null) { $this->atts = $this->sanitize_attributes($atts); $this->config = presscore_get_config(); return $this->blog_masonry(); }
function presscore_add_metro_slideshow_scripts() { $config = presscore_get_config(); if ('slideshow' == $config->get('header_title') && 'metro' == $config->get('slideshow_mode')) { $slider_rows = $config->get('slideshow_slides_in_raw') ? absint($config->get('slideshow_slides_in_raw')) : 3; $clider_cols = $config->get('slideshow_slides_in_column') ? absint($config->get('slideshow_slides_in_column')) : 6; ?> <script type="text/javascript"> var swiperColH = <?php echo $slider_rows; ?> , swiperCol = <?php echo $clider_cols; ?> ; </script> <?php } // metro slideshow }
protected function setup_config() { $config = presscore_get_config(); $attributes =& $this->atts; $config->set('template', 'albums'); $config->set('template.layout.type', 'masonry'); $config->set('layout', 'grid'); $config->set('justified_grid', false); $config->set('all_the_same_width', true); $config->set('post.preview.width.min', $attributes['width'], 300); $config->set('post.preview.buttons.details.enabled', false); $config->set('post.preview.load.effect', false); $config->set('show_titles', $attributes['show_title']); $config->set('show_excerpts', $attributes['show_excerpt']); if ('under_image' == $attributes['descriptions']) { $config->set('post.preview.background.enabled', !in_array($attributes['bg_under_albums'], array('disabled', ''))); $config->set('post.preview.background.style', $attributes['bg_under_albums']); } else { $config->set('post.preview.background.enabled', false); $config->set('post.preview.background.style', false); } $config->set('post.preview.description.style', $attributes['descriptions']); $config->set('post.preview.description.alignment', $attributes['content_aligment']); $config->set('post.preview.hover.animation', $attributes['hover_animation']); $config->set('post.preview.hover.color', $attributes['hover_bg_color']); $config->set('post.preview.hover.content.visibility', $attributes['hover_content_visibility']); $config->set('post.preview.mini_images.enabled', $attributes['show_miniatures']); $config->set('post.meta.fields.media_number', $attributes['show_media_count']); $config->set('post.meta.fields.date', $attributes['show_date']); $config->set('post.meta.fields.categories', $attributes['show_categories']); $config->set('post.meta.fields.comments', $attributes['show_comments']); $config->set('post.meta.fields.author', $attributes['show_author']); }
* Blog simple post content * * @package vogue * @since 1.0.0 */ // File Security Check if (!defined('ABSPATH')) { exit; } ?> <div class="blog-content wf-td"> <?php dt_get_template_part('blog/blog-post-content-part', get_post_format()); ?> <?php if (presscore_get_config()->get('show_details')) { echo presscore_post_details_link(); } ?> <?php echo presscore_new_posted_on('post'); ?> <?php echo presscore_post_edit_link(); ?> </div>
function presscore_set_image_dimesions() { $config = presscore_get_config(); if ($config->get('justified_grid')) { $target_image_height = $config->get('target_height'); $target_image_height *= 1.3; $image_options = array('h' => round($target_image_height), 'z' => 0); } else { $columns = $config->get('template.columns.number'); $content_width = $config->get('template.content.width'); $target_image_width = $config->get('post.preview.width.min'); if (false !== strpos($content_width, '%')) { $content_width = absint(str_replace('%', '', $content_width)); $content_width = round($content_width * 19.2); } else { $content_width = absint(str_replace('px', '', $content_width)); } if ($columns) { $computed_width = max(array($content_width / $columns, $target_image_width)); } else { $computed_width = $target_image_width; } if ('wide' == $config->get('post.preview.width') && !$config->get('all_the_same_width')) { $computed_width *= 3; $image_options = array('w' => absint(round($computed_width)), 'z' => 0, 'hd_convert' => false); } else { $computed_width *= 1.5; $image_options = array('w' => absint(round($computed_width)), 'z' => 0); } } return $image_options; }
function presscore_display_posts_filter($args = array()) { $default_args = array('post_type' => 'post', 'taxonomy' => 'category', 'query' => null); $args = wp_parse_args($args, $default_args); $config = presscore_get_config(); $load_style = $config->get('load_style'); // categorizer $filter_args = array(); if ($config->get('template.posts_filter.terms.enabled')) { // $posts_ids = $terms_ids = array(); $display = $config->get('display'); $select = $display['select']; // categorizer args $filter_args = array('taxonomy' => $args['taxonomy'], 'post_type' => $args['post_type'], 'select' => $select); if ('default' == $load_style && 'masonry' == $config->get('layout')) { if ($args['query'] && $args['query']->have_posts()) { foreach ($args['query']->posts as $p) { $p_ids[] = $p->ID; } // get posts terms $terms_ids = wp_get_object_terms($p_ids, $args['taxonomy'], array('fields' => 'ids')); $terms_ids = array_unique($terms_ids); $filter_args['terms'] = $terms_ids; } $filter_args['select'] = 'only'; } elseif ('category' == $display['type']) { $terms_ids = empty($display['terms_ids']) ? array() : $display['terms_ids']; $filter_args['terms'] = $terms_ids; } elseif ('albums' == $display['type']) { $posts_ids = isset($display['posts_ids']) ? $display['posts_ids'] : array(); $filter_args['post_ids'] = $posts_ids; } } $filter_class = ''; if ('default' != $load_style) { $filter_class .= ' with-ajax'; } else { $filter_class .= ' without-isotope'; } // display categorizer presscore_get_category_list(array('data' => dt_prepare_categorizer_data($filter_args), 'class' => 'filter' . $filter_class)); }
/** * Body classes filter. * * @param array $classes * @return array */ function dt_woocommerce_body_class($classes) { if (is_product() && 'disabled' !== presscore_get_config()->get('header_title')) { $classes[] = 'hide-product-title'; } return $classes; }
/** * Get header logos meta. * * @return array. */ function presscore_get_header_logos_meta() { $config = presscore_get_config(); return array('logo' => dt_get_uploaded_logo($config->get('logo.header.regular')), 'logo_retina' => dt_get_uploaded_logo($config->get('logo.header.hd'), 'retina')); }
protected function restore_theme_config() { presscore_get_config()->reset($this->config_backup); unset($this->config_backup); }
function presscore_get_blog_query() { $config = presscore_get_config(); $orderby = $config->get('orderby'); $query_args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => dt_get_paged_var(), 'order' => $config->get('order'), 'orderby' => 'name' == $orderby ? 'title' : $orderby); $ppp = $config->get('posts_per_page'); if ($ppp) { $query_args['posts_per_page'] = intval($ppp); } $display = $config->get('display'); if (!empty($display['terms_ids'])) { $terms_ids = array_values($display['terms_ids']); switch ($display['select']) { case 'only': $query_args['category__in'] = $terms_ids; break; case 'except': $query_args['category__not_in'] = $terms_ids; } } // get filter request $request_display = $config->get('request_display'); if ($request_display) { // get all category terms $all_terms = get_categories(array('type' => 'post', 'hide_empty' => 1, 'hierarchical' => 0, 'taxonomy' => 'category', 'pad_counts' => false)); // populate $all_terms_array with terms names $all_terms_array = array(); foreach ($all_terms as $term) { $all_terms_array[] = $term->term_id; } // except for empty term that appers when all filter category selcted, see it's url if (0 == current($request_display['terms_ids'])) { $request_display['terms_ids'] = $all_terms_array; } // override base tax_query $query_args['tax_query'] = array(array('taxonomy' => 'category', 'field' => 'id', 'terms' => array_values($request_display['terms_ids']), 'operator' => 'IN')); if ('except' == $request_display['select']) { $query_args['tax_query'][0]['operator'] = 'NOT IN'; } } $query = new WP_Query($query_args); return $query; }
protected function setup_config() { $config = presscore_get_config(); $config->set('template', 'portfolio'); $config->set('template.layout.type', 'masonry'); $config->set('layout', 'grid'); $config->set('justified_grid', false); $config->set('all_the_same_width', true); $config->set('post.preview.width.min', $this->atts['width'], 300); $config->set('post.preview.load.effect', false); $config->set('show_titles', $this->atts['show_title']); $config->set('show_excerpts', $this->atts['show_excerpt']); if ('under_image' == $this->atts['appearance']) { $config->set('post.preview.background.enabled', !in_array($this->atts['bg_under_projects'], array('disabled', ''))); $config->set('post.preview.background.style', $this->atts['bg_under_projects']); } else { $config->set('post.preview.background.enabled', false); $config->set('post.preview.background.style', false); } $config->set('post.preview.description.style', $this->atts['appearance']); $config->set('post.preview.description.alignment', $this->atts['content_aligment']); $config->set('post.preview.hover.animation', $this->atts['hover_animation']); $config->set('post.preview.hover.color', $this->atts['hover_bg_color']); $config->set('post.preview.hover.content.visibility', $this->atts['hover_content_visibility']); $config->set('show_links', $this->atts['show_link']); $config->set('show_details', $this->atts['show_details']); $config->set('show_zoom', $this->atts['show_zoom']); $config->set('post.meta.fields.date', $this->atts['show_date']); $config->set('post.meta.fields.categories', $this->atts['show_categories']); $config->set('post.meta.fields.comments', $this->atts['show_comments']); $config->set('post.meta.fields.author', $this->atts['show_author']); }
$thumb_id = get_post_thumbnail_id(); $thumb_meta = wp_get_attachment_image_src($thumb_id, 'full'); dt_get_thumb_img(array('class' => $img_class . ' rollover rollover-zoom dt-single-mfp-popup dt-mfp-item mfp-image', 'img_meta' => $thumb_meta, 'img_id' => $thumb_id, 'options' => $img_options, 'wrap' => '<a %HREF% %CLASS% %CUSTOM% title="%RAW_ALT%" data-dt-img-description="%RAW_TITLE%"><img %IMG_CLASS% %SRC% %SIZE% %IMG_TITLE% %ALT% /></a>')); } // post content the_content(); } ?> <?php wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'the7mk2'), 'after' => '</div>')); ?> <?php $post_tags = ''; $config = presscore_get_config(); if ($config->get('post.meta.fields.tags')) { $post_tags = presscore_get_post_tags_html(); } $share_buttons = presscore_display_share_buttons_for_post('post', array('echo' => false)); if ($share_buttons || $post_tags) { printf('<div class="post-meta wf-mobile-collapsed">%s</div>', $post_tags . $share_buttons); } ?> <?php // 'theme options' -> 'general' -> 'show author info on blog post pages' if ($config->get('post.author_block')) { presscore_display_post_author(); } ?>
protected function setup_config(&$attributes) { $config = presscore_get_config(); $config->set('template', 'testimonials'); $config->set('layout', 'masonry'); $config->set('template.layout.type', 'masonry'); $config->set('full_width', $attributes['full_width']); $config->set('item_padding', $attributes['padding']); $config->set('post.preview.width.min', $attributes['column_width']); $config->set('template.columns.number', $attributes['columns']); $config->set('post.preview.load.effect', $attributes['loading_effect']); $config->set('post.preview.description.style', 'disabled'); $config->set('load_style', 'default'); }
<?php // File Security Check if (!defined('ABSPATH')) { exit; } $category = presscore_get_config()->get('subcategory'); do_action('woocommerce_before_subcategory', $category); ?> <?php do_action('woocommerce_before_subcategory_title', $category); ?> <?php if (presscore_get_config()->get('show_titles') && get_the_title()) { ?> <a href="<?php echo get_term_link($category->slug, 'product_cat'); ?> "> <h3> <?php echo $category->name; if ($category->count > 0) { echo apply_filters('woocommerce_subcategory_count_html', ' <mark class="count">(' . $category->count . ')</mark>', $category); } ?> </h3> </a>
<?php // File Security Check if (!defined('ABSPATH')) { exit; } $category = presscore_get_config()->get('subcategory'); ?> <div class="project-list-media"> <div class="buttons-on-img"> <?php dt_woocommerce_subcategory_thumbnail($category, 'alignnone'); ?> </div> </div> <div class="project-list-content"> <?php dt_woocommerce_template_subcategory_description(); ?> </div>
function dt_woocommerce_search_loop_post_content() { if ('product' != get_post_type()) { return; } static $products_config = array(); $config = presscore_get_config(); $config_back = $config->get(); if (empty($products_config)) { // $config->set( 'post.preview.background.enabled', false ); // $config->set( 'post.preview.background.style', false ); $config->set('post.preview.description.style', 'under_image'); $config->set('post.preview.description.alignment', 'center'); $config->set('show_titles', true); $config->set('show_details', true); $config->set('product.preview.show_price', true); $config->set('product.preview.show_rating', false); $config->set('product.preview.icons.show_cart', true); $products_config = $config->get(); dt_woocommerce_product_info_controller(); } else { $config->reset($products_config); } get_template_part('woocommerce/content-product'); $config->reset($config_back); }
} // Increase loop count $woocommerce_loop['loop']++; // Extra post classes $classes = array('post'); if (0 == ($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns']) { $classes[] = 'first'; } if (0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns']) { $classes[] = 'last'; } do_action('presscore_before_post'); ?> <article <?php post_class($classes); ?> > <?php woocommerce_show_product_loop_sale_flash(); if ('under_image' == presscore_get_config()->get('post.preview.description.style')) { dt_woocommerce_template_product_desc_under(); } else { dt_woocommerce_template_product_desc_rollover(); } ?> </article> <?php do_action('presscore_after_post');
function presscore_config_filter_values() { $config = presscore_get_config(); if ($config->get('justified_grid')) { if ('on_hoover' == $config->get('post.preview.description.style')) { $config->set('post.preview.description.style', 'on_hoover_centered'); } } }
/** * Description here * * @since 1.0.0 * @return int Project rollover buttons count */ function presscore_project_preview_buttons_count() { $buttons_count = 0; if (!post_password_required()) { $config = presscore_get_config(); // details button if ($config->get('show_details')) { $buttons_count++; } // zoom button if ($config->get('show_zoom')) { $buttons_count++; } // link button if ($config->get('show_links') && $config->get('post.buttons.link.enabled') && in_the_loop()) { $buttons_count++; } } return $buttons_count; }