Ejemplo n.º 1
0
    function end_lvl(&$output, $depth = 0, $args = array())
    {
        $parent = $this->item_data;
        $menu_view = $parent->top_menu_view;
        $show_ul = true;
        $df = get_option('date_format');
        $indent = str_repeat("\t", $depth);
        if ($menu_view == 'thumb') {
            if ($depth >= 1) {
                $show_ul = false;
            }
        } else {
            if ($menu_view == 'thumb_title') {
                if ($depth >= 2) {
                    $show_ul = false;
                }
            }
        }
        if ($show_ul) {
            $output .= "{$indent}</ul>\n";
        }
        $type_depth = 1;
        if ($menu_view == 'thumb') {
            $type_depth = 0;
        }
        $item = $this->level_holder;
        if ($depth == $type_depth) {
            /******* Making the placeholder ********/
            if (!empty($this->level_holder)) {
                $item_id = $this->level_holder->object_id;
                $top_item = $this->item_data;
                $item = $this->level_holder;
                $thumb_size = getThumbSizes(array('thumb_size' => $this->top_menu_view == 'thumb_title' ? 'portfolio4' : 'image_large'));
                $width = $thumb_size['w'];
                $height = $thumb_size['h'];
                $item_thumb = getResizedImageUrl($item_id, $width, $height);
                if (empty($item_thumb)) {
                    $item_thumb_url = $this->level_holder->item_thumb;
                    $item_thumb = getResizedImageUrl($item_thumb_url, $width, $height);
                }
                $item_icon = $item->item_icon_class;
                if ($item->object != 'custom') {
                    $post_id = $item->object_id;
                    $item_pubdate = get_the_time($df, $post_id);
                    $post_obj = get_post($post_id);
                    if (is_object($post_obj)) {
                        $author_id = $post_obj->post_author;
                        $author_data = get_userdata($author_id);
                        $author_url = get_author_posts_url($author_id);
                        $author_name = $author_data->display_name;
                    } else {
                        $author_name = '';
                    }
                    $post_comments = wp_count_comments($post_id);
                    $comment_count = $post_comments->approved;
                    $post_title = get_the_title($post_id);
                    $post_link = $item->url;
                    $vis_width = $width;
                    $vis_height = $height;
                }
                if ($top_item->top_menu_view == 'thumb_title') {
                    $output .= '<div class="item_placeholder">
						<div class="thumb_wrap"><img src="' . $item_thumb . '" alt="" width="' . $vis_width . '" height="' . $vis_height . '" /></div>
						<div class="item_info">
						<div class="item_pubdate"><span>' . __('Posted', 'themerex') . '</span>&nbsp;<em>' . $item_pubdate . '</em></div>
						<div class="item_comments"><span class="icon icon-comment-1"></span>&nbsp;<em>' . $comment_count . '</em></div>
						</div>
						</div>';
                } else {
                    if ($top_item->top_menu_view == 'thumb') {
                        $this->thumb_placeholder = '<div class="item_placeholder">
						<div class="thumb_wrap"><img src="' . $item_thumb . '" alt="" width="' . $vis_width . '" height="' . $vis_height . '" /></div>
						<h4 class="item_title"><a href="' . $post_link . '">' . $post_title . '</a></h4>
						<div class="item_info">
						<div class="item_pubdate"><span>' . __('Posted', 'themerex') . '</span>&nbsp;<em>' . $item_pubdate . '</em></div>
						' . (!empty($author_name) ? '<div class="item_author"><span>' . __('by', 'themerex') . '</span>&nbsp;<em>' . $author_name . '</em></div>' : '') . '
						</div>
						</div>';
                    }
                }
            }
        }
        if (!empty($this->thumb_placeholder)) {
            if ($depth == $type_depth) {
                $output .= $this->thumb_placeholder;
            }
        }
        if ($depth == 0 && $menu_view != 'default') {
            $output .= '</li></ul>';
        }
    }
<?php

/*
 * The template for displaying one article of blog streampage with style "Excerpt"
 * 
 * @package spotlight
*/
$post_thumb = getResizedImageUrl($post_data['post_attachment'], '', 400, true);
$thumb_size = getimagesize($post_thumb);
$post_width = round($thumb_size[0] / 2);
$post_id = $post_data['post_id'];
$post_title = $post_data['post_title'];
$post_cats = $post_data['post_categories_list'];
$post_format = $post_data['post_format'];
?>
<article class="post isotopeElement divider <?php 
echo 'format-' . $post_data['post_format'] . ' post' . $opt['post_class'] . ($opt['number'] % 2 == 0 ? ' even' : ' odd') . ($opt['number'] == 0 ? ' first' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' last' : '') . ($opt['add_view_more'] ? ' viewmore' : '') . (get_custom_option('show_filters') == 'yes' ? ' flt_' . join(' flt_', get_custom_option('filter_taxonomy') == 'categories' ? $post_data['post_categories_ids'] : $post_data['post_tags_ids']) : '');
?>
" style="width:<?php 
echo $post_width;
?>
px" data-startwidth="<?php 
echo $post_width;
?>
">
	<a href="#" style="background:url(<?php 
echo $post_thumb;
?>
) center 0 no-repeat; display:block;" data-post-id="<?php 
echo $post_id;
?>
<?php

/* Template for default single portfolio post */
$mult = get_custom_option('retina_ready');
$post_data['post_views']++;
$post_thumb = '<img src="' . getResizedImageUrl($post_data['post_attachment'], 521 * $mult, 289 * $mult, true) . '" alt="">';
$post_title = '<h2>' . $post_data['post_title'] . '</h2>';
$post_info = '<header class="post_info infoPost">';
$post_info .= $post_title;
$post_info .= '<div class="subheader">';
if ($post_data['post_categories_links'] != '') {
    $post_info .= '<span class="post_cats filled">' . $post_data['post_categories_links'] . '</span>';
}
$post_info .= __('By', 'themerex') . '&nbsp;' . $post_data['post_author'];
$post_info .= '<span class="separator">|</span>';
$post_info .= '<span class="icon-clock-1"></span>' . $post_data['post_date'];
if ($post_data['post_comments'] != 0) {
    $post_info .= '<span class="separator">|</span>
	 				<a class="icon-comment-1" title="' . sprintf(__('Comments - %s', 'themerex'), $post_data['post_comments']) . '" href="' . $post_data['post_comments_link'] . '">' . $post_data['post_comments'] . '</a>';
}
$post_info .= '</div>';
$post_info .= '</header>';
$post_excerpt = '<div class="post_content">' . $post_data['post_excerpt'] . '</div>';
$post_id = $post_data['post_id'];
$post_link = '<a class="trex_more_link" href="' . get_permalink($post_id) . '">' . __('View post', 'themerex') . '</a>';
?>

<div class="isotopeElement appended itemscope" itemscope itemtype="http://schema.org/">
	<span class="close_button"></span>
	<?php 
if ($post_data['post_format'] != 'video') {