Esempio n. 1
0
function print_blog_item($item_xml)
{
    wp_reset_query();
    global $paged;
    global $sidebar;
    global $blog_div_size_num_class;
    if (empty($paged)) {
        $paged = get_query_var('page') ? get_query_var('page') : 1;
    }
    // get the item class and size from array
    $item_type = find_xml_value($item_xml, 'item-size');
    $item_class = $blog_div_size_num_class[$item_type]['class'];
    $item_index = $blog_div_size_num_class[$item_type]['index'];
    $full_content = find_xml_value($item_xml, 'show-full-blog-post');
    if ($sidebar == "no-sidebar") {
        $item_size = $blog_div_size_num_class[$item_type]['size'];
    } else {
        if ($sidebar == "left-sidebar" || $sidebar == "right-sidebar") {
            $item_size = $blog_div_size_num_class[$item_type]['size2'];
        } else {
            $item_size = $blog_div_size_num_class[$item_type]['size3'];
        }
    }
    // get the blog meta value
    $header = find_xml_value($item_xml, 'header');
    $num_fetch = find_xml_value($item_xml, 'num-fetch');
    $num_excerpt = find_xml_value($item_xml, 'num-excerpt');
    $category = find_xml_value($item_xml, 'category');
    $category = $category == 'All' ? '' : $category;
    if (!empty($category)) {
        $category_term = get_term_by('name', $category, 'category');
        $category = $category_term->slug;
    }
    // print header
    if (!empty($header)) {
        echo '<h3 class="blog-header-title title-color mb15 gdl-title">' . $header . '</h3>';
    }
    // start fetching database
    query_posts(array('post_type' => 'post', 'paged' => $paged, 'category_name' => $category, 'posts_per_page' => $num_fetch));
    echo '<div id="blog-item-holder" class="blog-item-holder">';
    if ($item_type == '1/1 Full Thumbnail') {
        print_blog_full($item_class, $item_size, $item_index, $num_excerpt, $full_content);
    } else {
        if ($item_type == '1/1 Medium Thumbnail') {
            print_blog_medium($item_class, $item_size, $item_index, $num_excerpt);
        } else {
            if ($item_type == 'Widget Style') {
                print_blog_widget($item_class, $item_size, $item_index, $num_excerpt);
            } else {
                print_blog_grid($item_class, $item_size, $item_index, $num_excerpt);
            }
        }
    }
    echo '</div>';
    echo '<div class="clear"></div>';
    if (find_xml_value($item_xml, "pagination") == "Yes") {
        pagination();
    }
}
Esempio n. 2
0
function print_blog_item($item_xml)
{
    $additional = '';
    $additional_html = '';
    $blog_type = find_xml_value($item_xml, 'blog-type');
    if ($blog_type == 'Carousel') {
        $additional = 'navigation-on';
    }
    $offset = find_xml_value($item_xml, 'offset');
    $pagination = find_xml_value($item_xml, "pagination");
    $view_all_blog = find_xml_value($item_xml, 'read-the-blog');
    if (!empty($view_all_blog) && $view_all_blog != 'None') {
        global $gdl_admin_translator;
        if ($gdl_admin_translator == 'enable') {
            $translator_view = get_option(THEME_SHORT_NAME . '_translator_read_the_blog', 'Read The Blog');
        } else {
            $translator_view = __('Read The Blog', 'gdl_front_end');
        }
        $additional_html = '<a href="' . get_permalink(get_page_by_path($view_all_blog));
        $additional_html = $additional_html . '" class="view-all-projects">';
        $additional_html = $additional_html . $translator_view . '</a>';
    }
    print_item_header(find_xml_value($item_xml, 'header'), $additional, $additional_html, find_xml_value($item_xml, 'icon-class'));
    global $paged, $sidebar_type, $blog_div_size_num_class;
    $paged = get_query_var('paged') ? get_query_var('paged') : get_query_var('page');
    $paged = $paged ? $paged : 1;
    if ($pagination == "No") {
        $paged = 1;
    }
    if ($paged != '1') {
        $offset = "";
    }
    // get the item class and size from array
    $item_type = find_xml_value($item_xml, 'item-size');
    $item_class = $blog_div_size_num_class[$item_type]['class'];
    $item_size = $blog_div_size_num_class[$item_type][$sidebar_type];
    // get the blog meta value
    $num_fetch = find_xml_value($item_xml, 'num-fetch');
    $num_excerpt = find_xml_value($item_xml, 'num-excerpt');
    $full_content = find_xml_value($item_xml, 'show-full-blog-post');
    $blog_thumbnail = find_xml_value($item_xml, 'show-thumbnail');
    if ($blog_thumbnail == 'No') {
        $item_size = '';
    }
    $category = find_xml_value($item_xml, 'category', false);
    $category = $category == 'All' ? '' : $category;
    $order = find_xml_value($item_xml, 'order');
    $orderby = find_xml_value($item_xml, 'orderby');
    // start fetching database
    query_posts(array('post_type' => 'post', 'paged' => $paged, 'order' => $order, 'orderby' => $orderby, 'category_name' => $category, 'posts_per_page' => $num_fetch, 'offset' => $offset));
    // printing each blog function
    echo '<div class="blog-item-holder">';
    if ($item_type == '1/4 Blog Widget' || $item_type == '1/3 Blog Widget' || $item_type == '1/2 Blog Widget' || $item_type == '1/1 Blog Widget') {
        if ($blog_type == 'Carousel') {
            print_blog_widget_carousel($item_class, $item_size, $num_excerpt, $full_content, $item_type);
        } else {
            print_blog_widget($item_class, $item_size, $num_excerpt, $full_content, $item_type);
        }
    } else {
        if ($item_type == '1/1 Blog List') {
            print_blog_list($item_class, $item_size);
        } else {
            if ($item_type == '1/1 Medium Thumbnail') {
                print_blog_medium($item_class, $item_size, $num_excerpt, $full_content);
            } else {
                if ($item_type == '1/1 Full Thumbnail') {
                    print_blog_full($item_class, $item_size, $num_excerpt, $full_content);
                }
            }
        }
    }
    echo '</div>';
    echo '<div class="clear"></div>';
    if ($pagination == "Yes") {
        pagination();
    }
    wp_reset_query();
}
Esempio n. 3
0
        $item_type = '1/4 Grid Style';
        $item_class = $package_div_size_num_class[$item_type]['class'];
        $item_size = $package_div_size_num_class[$item_type][$sidebar_type];
        $num_excerpt = 150;
        print_widget_package($item_class, $item_size, $item_type, $num_excerpt);
    } else {
        // blog archive
        $item_type = get_option(THEME_SHORT_NAME . '_search_archive_item_size', '1/1 Full Thumbnail');
        $num_excerpt = get_option(THEME_SHORT_NAME . '_search_archive_num_excerpt', 285);
        $full_content = get_option(THEME_SHORT_NAME . '_search_archive_full_blog_content', 'No');
        global $blog_div_size_num_class;
        $item_class = $blog_div_size_num_class[$item_type]['class'];
        $item_size = $blog_div_size_num_class[$item_type][$sidebar_type];
        echo '<div id="blog-item-holder" class="blog-item-holder">';
        if ($item_type == '1/4 Blog Widget' || $item_type == '1/3 Blog Widget' || $item_type == '1/2 Blog Widget' || $item_type == '1/1 Blog Widget') {
            print_blog_widget($item_class, $item_size, $num_excerpt, $full_content, $item_type);
        } else {
            if ($item_type == '1/1 Medium Thumbnail') {
                print_blog_medium($item_class, $item_size, $num_excerpt, $full_content);
            } else {
                if ($item_type == '1/1 Full Thumbnail') {
                    print_blog_full($item_class, $item_size, $num_excerpt, $full_content);
                }
            }
        }
        echo '</div>';
        // blog-item-holder
    }
}
echo '<div class="clear"></div>';
pagination();