1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| function widget( $args, $instance ) {
extract( $args );
$title = apply_filters('widget_title', $instance['posts_list_title'] );
$no_of_posts = $instance['no_of_posts'];
$posts_order = $instance['posts_order'];
$thumb = $instance['thumb'];
echo $before_widget;
echo $before_title;
echo $title ; ?>
<?php echo $after_title; ?>
<ul>
<?php
if( $posts_order == 'popular' )
tie_popular_posts($no_of_posts , $thumb);
elseif( $posts_order == 'random' )
tie_random_posts($no_of_posts , $thumb);
elseif( $posts_order == 'viewed' )
tie_most_viewed_posts($no_of_posts , $thumb);
elseif( $posts_order == 'best' )
tie_best_reviews_posts($no_of_posts , $thumb);
else
tie_last_posts($no_of_posts , $thumb)?>
</ul>
<div class="clear"></div>
<?php
echo $after_widget;
} |
Partager