Exemple #1
0
    <article <?php 
    post_class('loop-entry span_6 col count-' . $att_count);
    ?>
>  
		<?php 
    if (has_post_thumbnail()) {
        ?>
            <div class="loop-entry-thumbnail">
                <a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
"><img src="<?php 
        echo aq_resize(wp_get_attachment_url(get_post_thumbnail_id()), att_img('blog_entry_width'), att_img('blog_entry_height'), att_img('blog_entry_crop'));
        ?>
" alt="<?php 
        echo the_title();
        ?>
" /></a>
            </div><!-- /loop-entry-thumbnail -->
        <?php 
    }
    ?>
        <div class="loop-entry-content">
			<h2><a href="<?php 
    the_permalink();
    ?>
" title="<?php 
    the_title();
    /** @see WP_Widget::widget */
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $category = apply_filters('widget_title', $instance['category']);
        $number = apply_filters('widget_title', $instance['number']);
        $offset = apply_filters('widget_title', $instance['offset']);
        ?>
              <?php 
        echo $before_widget;
        ?>
                  <?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
							<div class="att-widget-recent-posts blog">
							<?php 
        global $post;
        $tmp_post = $post;
        $args = array('numberposts' => $number, 'offset' => $offset, 'category' => $category);
        $myposts = get_posts($args);
        foreach ($myposts as $post) {
            setup_postdata($post);
            if (has_post_thumbnail()) {
                ?>
									<article class="clr">
										<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
" class="title">
                                        	<img src="<?php 
                echo aq_resize(wp_get_attachment_url(get_post_thumbnail_id()), att_img('blog_entry_width'), att_img('blog_entry_height'), true);
                ?>
" alt="<?php 
                the_title();
                ?>
" />
                                        </a>
                                        <a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
" class="att-recent-posts-title"><?php 
                the_title();
                ?>
</a>
                                        <div class="att-recent-posts-date"><?php 
                echo get_the_date();
                ?>
</div>
                                    </article>
                               <?php 
            }
        }
        $post = $tmp_post;
        ?>
							</div>
              <?php 
        echo $after_widget;
        ?>
        <?php 
    }