Пример #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') {
Пример #3
0
/**
 * Show latest portfolio thumbnail!
 */
function wipfr_latest_portfolio_thumbnail($count, $catID = 0)
{
    $return = '<ul class="latest_portfolio_thumbnail">' . "\n";
    $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()) {
        while ($pQuery->have_posts()) {
            $pQuery->the_post();
            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'), 85, 85, true) : '';
            $colImage = is_array($imgArray) ? $imgArray['url'] : get_template_directory_uri() . '/images/default-portfolio-85x85.jpg';
            $colImageGrayscale = is_array($imgArray) && isset($imgArray['path']) ? wip_print_grayscale_autoresize($imgArray['path'], $imgArray['url']) : '';
            $return .= '<li class="portfolio_widget_item">' . "\n";
            $return .= '<a class="portfolio_widget_thumbnail" href="' . get_permalink($post->ID) . '" title="' . the_title_attribute('echo=0') . '">' . "\n";
            $return .= '<img class="portfolio_widget_thumbnail_gray" src="' . $colImageGrayscale . '" alt="' . the_title_attribute('echo=0') . '" />';
            $return .= '<img class="portfolio_widget_thumbnail_default" src="' . $colImage . '" alt="' . the_title_attribute('echo=0') . '" />';
            $return .= '</a>' . "\n";
            $return .= '</li>' . "\n";
        }
    } else {
    }
    wp_reset_postdata();
    $return .= '</ul>' . "\n";
    $return .= '<div class="clear"></div>' . "\n";
    return $return;
}
 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;
 }
Пример #5
0
    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;
            ?>
">
    function _wip_latest_woo_product($number, $catID, $featured)
    {
        $pr = "";
        ob_start();
        $query_args = array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product');
        $query_args['meta_query'] = array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN'));
        if (!$featured && ($catID && $catID != "" && $catID !== 0)) {
            $query_args['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => intval($catID), 'operator' => 'IN'));
        }
        if ($featured) {
            $args['meta_key'] = '_featured';
            $args['meta_value'] = 'yes';
        }
        $r = new WP_Query($query_args);
        if ($r->have_posts()) {
            echo '<ul class="product_list_widget">' . "\n";
            while ($r->have_posts()) {
                $r->the_post();
                global $post, $product;
                $img = has_post_thumbnail() && wip_get_attached_file($post->ID) ? wip_print_autoresize(wip_get_attached_file($post->ID), get_thumbOri($post->ID, 'full'), 70, 70) : get_template_directory_uri() . '/images/no-preview.jpg';
                ?>
		<li><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title_attribute();
                ?>
">
			<img src="<?php 
                echo $img;
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
"/>
			<?php 
                if (get_the_title()) {
                    the_title();
                } else {
                    the_ID();
                }
                ?>
		</a> <?php 
                echo $product->get_price_html();
                ?>
</li>
<?php 
            }
            echo '</ul>' . "\n";
        }
        wp_reset_postdata();
        $woo_product = ob_get_clean();
        return $woo_product;
    }