Popular post fix

Closed - This job posting has been filled and work has been completed.
Web & Mobile Development Web Development Posted 2 years ago

Fixed Price

Delivery by December 9, 2012

$15.00

Budget

Details

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="" />
                        <?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?


About the Client

(4.88) 84 reviews

Sweden
Stockholm 06:29 PM

187 Jobs Posted
65% Hire Rate, 1 Open Job

$4,500 Total Spent
123 Hires, 1 Active

$4.57/hr Avg Hourly Rate Paid
267 Hours

Member Since Feb 9, 2011