示例#1
0
				<div class="standard-blog-lists">	
				<?php 
        if (has_post_thumbnail() && wip_get_attached_file($post->ID)) {
            ?>
			
					<div class="standard-blog-thumbnail">
						<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(__('Permanent Link to %s', 'wip'), the_title_attribute('echo=0'));
            ?>
">
							<img src="<?php 
            echo wip_print_autoresize(wip_get_attached_file($post->ID), get_thumbOri($post->ID, 'full'), 690, 250);
            ?>
" alt="<?php 
            the_title_attribute();
            ?>
"/>
						</a>
					</div>			
				<?php 
        }
        ?>
								
					<div class="standard-blog-excerpt">
						<h3 class="blog-list-title">
							<a href="<?php 
        the_permalink();
示例#2
0
	<span class="meta-blog-lists">									<?php 
        print __('Posted In', 'wip');
        ?>
 <?php 
        the_category(', ');
        ?>
, <?php 
        printf(__('On %1$s', 'wip'), get_the_time('F d, Y', $post->ID));
        ?>
				</span>
	
	<?php 
        #if user set the featured images for this post!
        if (has_post_thumbnail() && wip_get_attached_file($post->ID)) {
            echo '<div class="single-full-blog-thumbnail">' . "\n";
            echo '<img src="' . wip_print_autoresize(wip_get_attached_file($post->ID), get_thumbOri($post->ID, 'full'), 700, 9999, false) . '" alt="' . the_title_attribute('echo=0') . '"/>';
            echo '</div>' . "\n";
        }
        ?>
	
	<div class="single-blog-entry-content">
	
	<?php 
        the_content();
        ?>

		<div class="clear"></div>
	</div>

	<?php 
        if (get_option('bd_blog_related_off') !== '0') {
/**
 * Print portfolio object
 * use in single portfolio page
 */
function _wip_print_portfolio_object()
{
    global $post;
    $isThere = false;
    $imageUrl = "";
    $video = "";
    $type = "";
    $preview = "";
    $vidType = "";
    $postID = $post->ID;
    if (!is_object($postID)) {
        $postID = (int) $postID;
    }
    $portfolioObjectID = get_post_meta($postID, '_wip_bd_portfolio', true);
    $portfolioData = get_option('bd_portfolio_data');
    if (!empty($portfolioData)) {
        if (array_key_exists($portfolioObjectID, $portfolioData)) {
            $port = $portfolioData[$portfolioObjectID];
            if ($port['type'] == 'image') {
                if (isset($port['image']) && is_array($port['image'])) {
                    $isThere = true;
                    $type = 'image';
                    $uploadPath = wp_upload_dir();
                    $imageDir = $uploadPath['basedir'] . $port['image']['subdir'] . '/' . $port['image']['image'];
                    $imageUrl = $uploadPath['baseurl'] . $port['image']['subdir'] . '/' . $port['image']['image'];
                    $preview = wip_print_autoresize($imageDir, $imageUrl, 700, 9999, false);
                }
            } elseif ($port['type'] == 'video') {
                if ($port['video'] != "") {
                    $isThere = true;
                    $type = 'video';
                    $video = $port['video'];
                    $vidType = typeOflink($video);
                }
            }
        }
    }
    if (!$isThere) {
        print '<p>' . __('Please set your portfolio object, by uploading an image or enter a video URL in custom metabox under the text editor!', 'wip') . '</p>';
    }
    if ($type !== "") {
        if ($type == 'image') {
            echo '<a href="' . $imageUrl . '" rel="prettyPhoto" title="' . the_title_attribute('echo=0') . '"><img src="' . $preview . '" alt="' . the_title_attribute('echo=0') . '" /></a>' . "\n";
        } else {
            if ($type == 'video') {
                echo WIPobjectPrint($video, $vidType, '700', '525', 'false');
            }
        }
    }
    return false;
}
 function _print_column_portfolio_lists($count, $catID)
 {
     $content = "";
     $args = array('post_type' => 'portfolio-item', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => $count, 'paged' => false);
     if ($catID && $catID != "" && $catID !== 0) {
         $args['tax_query'] = array(array('taxonomy' => 'portfolio-category', 'field' => 'id', 'terms' => intval($catID), 'operator' => 'IN'));
     }
     $pQuery = new WP_Query($args);
     if ($pQuery->have_posts()) {
         $content .= '<div class="col_wraper no_margin">' . "\n";
         $intloop = 0;
         while ($pQuery->have_posts()) {
             $pQuery->the_post();
             $intloop++;
             global $post;
             $specialStyle = "";
             if ($intloop == 1 || $intloop % 3 == 1) {
                 $specialStyle = " no_margin_left";
             }
             if ($intloop % 3 == 0) {
                 $specialStyle = " no_margin_right";
             }
             $imgArray = has_post_thumbnail() && wip_get_attached_file($post->ID) ? wip_print_autoresize(wip_get_attached_file($post->ID), get_thumbOri($post->ID, 'full'), 220, 168, true) : '';
             $colImage = is_array($imgArray) ? $imgArray['url'] : get_template_directory_uri() . '/images/no-preview.jpg';
             $colImageGrayscale = is_array($imgArray) && isset($imgArray['path']) ? wip_print_grayscale_autoresize($imgArray['path'], $imgArray['url']) : '';
             $content .= '<div class="col_four float_left' . $specialStyle . '">' . "\n";
             $content .= '<div class="portfolio-thumbnail">' . "\n";
             $content .= '<a href="' . get_permalink($post->ID) . '" title="' . sprintf(__('Permanent Link to %s', 'wip'), the_title_attribute('echo=0')) . '">' . "\n";
             $content .= '<img class="portfolio-grayscale" src="' . $colImageGrayscale . '" alt="' . the_title_attribute('echo=0') . '"/>';
             $content .= '<img class="portfolio-original" src="' . $colImage . '" alt="' . the_title_attribute('echo=0') . '"/>';
             $content .= '</a>' . "\n";
             $content .= '</div>' . "\n";
             $content .= '<h3 class="portfolio-list-title"><a href="' . get_permalink($post->ID) . '" title="' . sprintf(__('Permanent Link to %s', 'wip'), the_title_attribute('echo=0')) . '">' . get_the_title() . '</a></h3>' . "\n";
             if ($post->post_excerpt) {
                 $content .= wpautop(wptexturize($post->post_excerpt));
             }
             $content .= '</div>' . "\n";
             if ($intloop % 3 == 0) {
                 $content .= '<div class="clear"></div>' . "\n";
             }
         }
         if ($intloop % 3 != 0) {
             $content .= '<div class="clear"></div>' . "\n";
         }
         $content .= '</div><!-- end .col_wraper -->' . "\n";
     } else {
         $content .= __('No Posts Found!', 'wip');
     }
     wp_reset_postdata();
     return $content;
 }
    if (have_posts()) {
        ?>

<div id="blog-related">
	<h2><span><?php 
        _e('Related Posts', 'wip');
        ?>
</span></h2>
<div class="col_wraper no_margin">
<?php 
        $intloop = 0;
        while (have_posts()) {
            the_post();
            $intloop++;
            global $post;
            $colImage = has_post_thumbnail() && wip_get_attached_file($post->ID) ? wip_print_autoresize(wip_get_attached_file($post->ID), get_thumbOri($post->ID, 'full'), 160, 104) : get_template_directory_uri() . '/images/no-preview.jpg';
            $specialStyle = "";
            if ($intloop == 1 || $intloop % 4 == 1) {
                $specialStyle = " no_margin_left";
            }
            if ($intloop % 4 == 0) {
                $specialStyle = " no_margin_right";
            }
            ?>
<div class="column-blog-lists col_four float_left<?php 
            echo $specialStyle;
            ?>
">

	<div class="column-blog-thumbnail">
	<a href="<?php 
    if (have_posts()) {
        ?>
<div id="portfolio-related">
<h2><span><?php 
        _e('Related Projects', 'wip');
        ?>
</span></h2>
<div class="col_wraper no_margin">

<?php 
        $intloop = 0;
        while (have_posts()) {
            the_post();
            $intloop++;
            global $post;
            $imgArray = has_post_thumbnail() && wip_get_attached_file($post->ID) ? wip_print_autoresize(wip_get_attached_file($post->ID), get_thumbOri($post->ID, 'full'), 220, 168, true) : '';
            $colImage = is_array($imgArray) ? $imgArray['url'] : get_template_directory_uri() . '/images/no-preview.jpg';
            $colImageGrayscale = is_array($imgArray) && isset($imgArray['path']) ? wip_print_grayscale_autoresize($imgArray['path'], $imgArray['url']) : '';
            $specialStyle = "";
            if ($intloop == 1 || $intloop % 4 == 1) {
                $specialStyle = " no_margin_left";
            }
            if ($intloop % 4 == 0) {
                $specialStyle = " no_margin_right";
            }
            ?>

<div class="col_four float_left<?php 
            echo $specialStyle;
            ?>
">
 /**
  * @since version 2.2
  * auto resize image for category listing
  * size was based on column number, and parent layout
  * so, no more resize the image via css, we do the right thing!
  */
 function _wip_dynamically_call_cat_thumbnail($category)
 {
     global $woocommerce, $woocommerce_loop, $sidebar_layout, $fullwidth_layout;
     $col = isset($woocommerce_loop['wip_cols']) ? $woocommerce_loop['wip_cols'] : $woocommerce_loop['columns'];
     $parentLayout = isset($woocommerce_loop['parent_layout']) && $woocommerce_loop['parent_layout'] != "" ? $woocommerce_loop['parent_layout'] : '';
     $parentLayout = $parentLayout == "" ? $fullwidth_layout ? 'fullwidth' : 'content-sidebar' : $parentLayout;
     $thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
     $full_img_data = wp_get_attachment_image_src($thumbnail_id, 'full', false);
     $image_seted = isset($full_img_data[0]) ? true : false;
     $full_img_url = isset($full_img_data[0]) ? $full_img_data[0] : '';
     $path = file_exists(get_attached_file($thumbnail_id)) ? get_attached_file($thumbnail_id) : '';
     $i_width = $i_height = 290;
     $colImage = "";
     if ('fullwidth' == $parentLayout) {
         switch ($col) {
             case '5':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 162, 162) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 162;
                 break;
             case '56':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 120, 120) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 120;
                 break;
             case '4':
             case '34':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 210, 210) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 210;
                 break;
             case '3':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 290, 290) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 290;
                 break;
             case '2':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 450, 450) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 450;
                 break;
         }
     } else {
         switch ($col) {
             case '5':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 114, 114) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 114;
                 break;
             case '4':
             case '34':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 150, 150) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 150;
                 break;
             case '3':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 210, 210) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 210;
                 break;
             case '2':
                 $colImage = $image_seted ? wip_print_autoresize($path, $full_img_url, 330, 330) : get_template_directory_uri() . '/images/no-preview.jpg';
                 $i_width = $i_height = 330;
                 break;
         }
     }
     echo '<div class="product_lists_thumbnail">' . "\n";
     echo '<a class="product_lists_thumbnail_wrap" href="' . get_term_link($category->slug, 'product_cat') . '" title="' . $category->name . '">' . "\n";
     echo '<img width="' . $i_width . 'px" height="' . $i_height . 'px" src="' . $colImage . '" alt="' . $category->name . '"/>' . "\n";
     echo '</a>' . "\n";
     echo '<h3 class="product-title-on-lists product-category-lists-title">' . "\n";
     echo '<a href="' . get_term_link($category->slug, 'product_cat') . '" title="' . $category->name . '">' . $category->name;
     if ($category->count > 0) {
         echo ' (' . $category->count . ')';
     }
     echo '</a>' . "\n";
     echo '</h3>' . "\n";
     echo '</div>' . "\n";
 }