<?php

$data_atts = $this->shortcode_atts_to_data_atts(array('show_featured_image', 'show_author', 'show_categories', 'show_date', 'show_rating', 'show_more', 'show_comments', 'date_format', 'posts_per_page', 'order', 'orderby', 'category_id', 'content_length', 'blog_feed_module_type', 'hover_overlay_icon'));
if ('standard' == $blog_feed_module_type && false === strpos($category_id, ',')) {
    $color = extra_get_category_color($category_id);
    $color_style = esc_attr(sprintf('border-color:%s;', $color));
} else {
    $color_style = '';
}
?>

<div class="posts-blog-feed-module post-module et_pb_extra_module <?php 
echo esc_attr($blog_feed_module_type);
?>
 <?php 
echo esc_attr($module_class);
?>
 paginated et_pb_extra_module" style="<?php 
echo esc_attr($color_style);
?>
" data-current_page="1" data-et_column_type="<?php 
echo esc_attr($_et_column_type);
?>
" <?php 
echo $data_atts;
?>
>
<?php 
if (!empty($feed_title)) {
    ?>
	<div class="module-head">
Example #2
0
function extra_get_blog_feed_page_options($post_id = 0)
{
    $post_id = empty($post_id) ? get_the_ID() : $post_id;
    $options = array();
    $options_fields = array('display_style', 'categories', 'posts_per_page', 'order', 'orderby', 'show_author', 'show_categories', 'show_featured_image', 'content_length', 'show_date', 'date_format');
    foreach ($options_fields as $options_field) {
        $options[$options_field] = get_post_meta($post_id, '_blog_feed_page_' . $options_field, true);
    }
    $options['border_color_style'] = '';
    $args = array('post_type' => 'post', 'posts_per_page' => isset($options['posts_per_page']) && is_numeric($options['posts_per_page']) ? $options['posts_per_page'] : 5, 'order' => $options['order'], 'orderby' => $options['orderby']);
    $paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
    $args['paged'] = $paged;
    if ('rating' == $options['orderby']) {
        $args['orderby'] = 'meta_value_num';
        $args['meta_key'] = '_extra_rating_average';
    }
    if (!empty($options['categories'])) {
        $args['tax_query'] = array(array('taxonomy' => 'category', 'field' => 'id', 'terms' => array_map('absint', explode(',', $options['categories'])), 'operator' => 'IN'));
        if ('standard' == $options['display_style'] && false === strpos($options['categories'], ',')) {
            $color = extra_get_category_color($options['categories']);
            $options['border_color_style'] = esc_attr(sprintf('border-color:%s;', $color));
            $options['category_color'] = $color;
        }
    }
    wp_reset_postdata();
    $options['posts_query'] = new WP_Query($args);
    return $options;
}
Example #3
0
 function shortcode_callback($atts, $content = null, $function_name)
 {
     $this->_process_shortcode_atts_category_id();
     if (!empty($this->shortcode_atts['category_id'])) {
         $categories = array_map('absint', explode(',', $this->shortcode_atts['category_id']));
         $term = get_term(absint($categories[0]), 'category');
         if (!empty($term)) {
             $this->shortcode_atts['term_name'] = $term->name;
             $this->shortcode_atts['term_color'] = extra_get_category_color($term->term_id);
         }
     }
     if (empty($term)) {
         $this->shortcode_atts['term_name'] = __('All', 'extra');
         $this->shortcode_atts['term_color'] = et_builder_accent_color();
     }
     $this->shortcode_atts['module_class'] = ET_Builder_Element::add_module_order_class('', $this->slug);
     $this->shortcode_atts['tab_id'] = ET_Builder_Module_Tabbed_Posts::add_child_data($this->shortcode_atts);
     $this->shortcode_atts['order'] = 'desc';
     $this->shortcode_atts['orderby'] = 'date';
     $this->shortcode_atts = array_merge($this->shortcode_atts, ET_Builder_Module_Tabbed_Posts::get_global_shortcode_atts());
     return parent::shortcode_callback($atts, $content, $function_name);
 }
Example #4
0
 function get_mega_item_border_top($item)
 {
     if (!isset($item->object_id)) {
         return "";
     }
     $category_color = extra_get_category_color($item->object_id);
     if (!$category_color) {
         return "";
     }
     return "border-top-color: {$category_color};";
 }