Popular post fix

Popular post fix

Closed - This job posting has been filled and work has been completed.

Job Description

Hi,

I have a tab with popular post on www.tradingportalen.com (in the bottom of right sidebar "Mest Lästa").

I want to set this to post with most views last week.

Here is the code:

<div class="tab" id="tabs-1">
<ul>
<?php
$popPosts = new WP_Query();
$week = date('W');
$year = date('Y');
$popPosts->query(array(
'ignore_sticky_posts' => 1,
'posts_per_page' => 5,
'year=' . $year . '&w=' . $week,
'orderby' => 'meta_value_num',
'meta_key' => 'views',
'order' => 'DESC'
));
while ($popPosts->have_posts()):
$popPosts->the_post();
?>
<li>
<?php
if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())): /* if post has post thumbnail */
?>
<?php
echo magman_image(array(
'class' => 'tab-img',
'url' => get_permalink(),
'width' => 55,
'height' => 55
));
?>
<?php
endif;
?>
<div class="details">
<h5><a href="<?php
the_permalink();
?>">
<?php
the_title();
?>
</a></h5>
<?php
$postid = get_the_ID();
?>
<?php
if (get_post_meta($postid, 'review_overall_score', true)):
?>
<img src="<?php
echo get_template_directory_uri();
?>/i/review/small_<?php
echo get_post_meta($postid, 'review_overall_score', true);
?>.png" alt="" /><br/>
<?php
endif;
?>
<span class="date">
<?php
the_time(get_option('date_format'));
?>
<?php
comments_popup_link(__('No comments', 'magman'), __('1 Comment', 'magman'), __('% Comments', 'magman'));
?>
</span> </div>
</li>
<?php
endwhile;
?>
<?php
wp_reset_query();
?>
</ul>
</div>

Can anyone give me the code for this?