Exemplo n.º 1
0
    function woo_widget_tabs_latest($posts = 5, $size = 45, $post_type = null)
    {
        global $post;
        $args = 'ignore_sticky_posts=1&numberposts=' . $posts . '&orderby=post_date&order=desc';
        if ($post_type) {
            $args .= '&post_type=' . $post_type;
        }
        $latest = get_posts($args);
        foreach ($latest as $post) {
            setup_postdata($post);
            ?>

	<li>
		<?php 
            if ($size != 0) {
                echo '<a href="' . get_permalink(get_the_ID()) . '" rel="bookmark" title="' . the_title_attribute(array('echo' => 0)) . '">' . woo_image_vimeo('height=' . $size . '&width=' . $size . '&class=thumbnail&single=true&id=' . get_the_ID()) . '</a>';
            }
            ?>

		<a title="<?php 
            the_title_attribute();
            ?>
" href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a>
		<span class="meta"><?php 
            the_time(get_option('date_format'));
            ?>
</span>
		<div class="fix"></div>
	</li>
	<?php 
        }
    }
Exemplo n.º 2
0
    return $query;
}
// End woo_popular_bycomments()
$popular = get_posts($args);
remove_filter('pre_get_posts', 'woo_popular_bycomments');
foreach ($popular as $post) {
    setup_postdata($post);
    $count++;
    ?>

		            <div class="post block">
		
		                <div class="tab-image-block">
		                	<?php 
    $args = 'key=image&width=' . $woo_options['woo_thumb_w'] . '&height=' . $woo_options['woo_thumb_h'] . '&class=thumbnail&link=img&return=true&id=' . get_the_ID();
    echo '<a href="' . get_permalink(get_the_ID()) . '" title="' . the_title_attribute(array('echo' => 0)) . '">' . woo_image_vimeo($args) . '</a>';
    ?>

		                </div>
		                
		                <h2 class="title"><a href="<?php 
    the_permalink();
    ?>
" rel="bookmark" title="<?php 
    the_title_attribute();
    ?>
"><?php 
    the_title();
    ?>
</a></h2>
		                
Exemplo n.º 3
0
                        echo $content;
                        ?>
</p><?php 
                    }
                    ?>
    		  		<a class="slide-overlay-toggle">#</a>
    			</div>
    			
    			<?php 
                }
                ?>
    			
    			<div class="image">
    			
    				<?php 
                echo woo_image_vimeo('key=image&width=760&id=' . $post->ID);
                ?>
    			
    			</div>
    		  
    		</div>
    		<?php 
            }
            ?>
    		
    	<?php 
        }
        // End For Loop
        ?>
    
    <?php 
Exemplo n.º 4
0
function woo_shortcode_related_posts_custom($atts)
{
    global $woo_options;
    extract(shortcode_atts(array('limit' => '5', 'image' => '', 'post_type' => '', 'width' => $woo_options['woo_thumb_w'], 'height' => $woo_options['woo_thumb_h']), $atts));
    global $wpdb, $post, $table_prefix;
    if ($post->ID) {
        $retval = '<ul class="woo-sc-related-posts">';
        // Get tags
        $tags = wp_get_post_tags($post->ID);
        $tagsarray = array();
        foreach ($tags as $tag) {
            $tagsarray[] = $tag->term_id;
        }
        $tagslist = implode(',', $tagsarray);
        // Do the query
        $q = "\r\r\n\t\t\tSELECT p.*, count(tr.object_id) as count\r\r\n\t\t\tFROM {$wpdb->term_taxonomy} AS tt, {$wpdb->term_relationships} AS tr, {$wpdb->posts} AS p\r\r\n\t\t\tWHERE tt.taxonomy ='post_tag'\r\r\n\t\t\t\tAND tt.term_taxonomy_id = tr.term_taxonomy_id\r\r\n\t\t\t\tAND tr.object_id  = p.ID\r\r\n\t\t\t\tAND tt.term_id IN ({$tagslist})\r\r\n\t\t\t\tAND p.ID != {$post->ID}\r\r\n\t\t\t\tAND p.post_status = 'publish'\r\r\n\t\t\t\tAND p.post_date_gmt < NOW()";
        // Filter by post type, if necessary.
        if ($post_type) {
            $q .= " AND p.post_type = '" . $post_type . "' ";
        }
        $q .= "\r\r\n\t\t\tGROUP BY tr.object_id\r\r\n\t\t\tORDER BY count DESC, p.post_date_gmt DESC\r\r\n\t\t\tLIMIT {$limit};";
        $related = $wpdb->get_results($q);
        if ($related) {
            foreach ($related as $r) {
                if ($image) {
                    $image_out = "";
                    $image_out .= '<a class="thumbnail" href="' . get_permalink($r->ID) . '">';
                    $image_out .= woo_image_vimeo("link=img&width=" . $width . "&height=" . $height . "&return=true&id=" . $r->ID);
                    $image_out .= '</a>';
                }
                $retval .= '<li>' . $image_out . '<a class="related-title" title="' . wptexturize($r->post_title) . '" href="' . get_permalink($r->ID) . '"><span>' . wptexturize($r->post_title) . '</span></a></li>';
            }
        } else {
            $retval .= '<li>' . __('No related videos found', 'woothemes') . '</li>';
        }
        $retval .= '</ul>';
        return $retval;
    }
    return;
}
    while (have_posts()) {
        the_post();
        $count++;
        ?>

	                                                                    
	            <!-- Post Starts -->
	            <div class="post <?php 
        if ($count % 3 == 0) {
            echo "last";
        }
        ?>
">
	               <?php 
        if ($woo_options['woo_post_content'] != 'content') {
            echo '<a href="' . get_permalink(get_the_ID()) . '" rel="bookmark" title="' . the_title_attribute(array('echo' => 0)) . '">' . woo_image_vimeo('width=180&height=' . $woo_options['woo_thumb_h'] . '&class=thumbnail&link=img&return=true') . '</a>';
        }
        ?>

	                <h2 class="title"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="<?php 
        the_title_attribute(array('echo' => 0));
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
	                <span class="date"><?php 
        the_time(get_option('date_format'));