All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.

Author Topic: Sorting this layout by views?  (Read 2176 times)

0 Members and 1 Guest are viewing this topic.

Offline xxxhackaxxx

  • Newbie
  • *
  • Posts: 1
    • View Profile
  • WordPress Version: WordPress 3.1.x
  • Theme Name: LeetPress
Sorting this layout by views?
« on: 06 August 2011, 01:45 »
My website is a Flash Games website and i want to list the 8 most viewed games. This is the code i use to show the 6 latest games (recently added), can someone edit it to sort by views? I have tried everything to my limit knowledge.

Code: [Select]
<div class="tab-content" style="display: block">
<p>
<?php
$args = array( 'post_type' => 'games''posts_per_page' => 6'orderby' => 'date''order' => 'DESC' );
$loop = new WP_Query$args );
$i 1;
while ( $loop->have_posts() ) : $loop->the_post(); ?>


<?php if($i%== 0) : ?>
<div class="one_half last">
<div class="game-item-cats second">
<div class="game-item-thumb"><?php if ( get_post_meta($post->ID'mabp_thumbnail_url'true) ) : ?> <img class="thumb" src="<?php echo get_post_meta($post->ID'mabp_thumbnail_url'true?>" alt="<?php the_title(); ?>" /><?php endif; ?></div>
<h5><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h5>
<span class="game-item-date"><?php the_timeget_option('date_format') ); ?> - </span><?php the_excerpt(); ?><span class="game-item-categry"><?php if(function_exists('the_views')) { the_views(); } ?> <b>&nbsp|&nbsp</b><?php the_category(', '?></span></div></div>

<?php else : ?>

<div class="one_half">
<div class="game-item-cats">
<div class="game-item-thumb"><?php if ( get_post_meta($post->ID'mabp_thumbnail_url'true) ) : ?> <img class="thumb" src="<?php echo get_post_meta($post->ID'mabp_thumbnail_url'true?>" alt="<?php the_title(); ?>" /><?php endif; ?></div>
<h5><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h5>
<span class="game-item-date"><?php the_timeget_option('date_format') ); ?> - </span><?php the_excerpt(); ?><span class="game-item-categry"><?php if(function_exists('the_views')) { the_views(); } ?><b>&nbsp|&nbsp</b><?php the_category(', '?></span></div></div>
<?php endif; ?>

<?php $i++; ?>

<?php endwhile; ?>
</p>
</div>



Help would me VERY much appreciated, usually i can work something out, but this i have been working on for weeks!!