Ver Mensaje Individual
  #8 (permalink)  
Antiguo 02/01/2014, 08:54
xfrancis
 
Fecha de Ingreso: septiembre-2009
Mensajes: 164
Antigüedad: 14 años, 7 meses
Puntos: 3
Respuesta: Ordenar posts por un valor alternativo

Si, he probado lo siguiente:
Código PHP:
<?php

 $querystr 
"
    SELECT $wpdb->wp_posts.* 
    FROM $wpdb->wp_posts, $wpdb->wp_wti_like_post
    WHERE $wpdb->wp_posts.ID = $wpdb->wp_wti_like_post.post_id 
    AND $wpdb->wp_posts.post_type = 'post'
    AND $wpdb->wp_posts.post_date < NOW()
    ORDER BY $wpdb->wp_wti_like_post.value DESC
 "
;


 
$pageposts $wpdb->get_results($querystrOBJECT);
 
 
?>

<?php if ($pageposts): ?>
  <?php global $post?>
  <?php foreach ($pageposts as $post): ?>
    <?php setup_postdata($post); ?>

    <div class="post" id="post-<?php the_ID(); ?>">
      <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
      <?php the_title(); ?></a></h2>
      <small><?php the_time('F jS, Y'?> <!-- by <?php the_author() ?> --></small>
      <div class="entry">
         <?php the_content('Read the rest of this entry »'); ?>
      </div>
  
      <p class="postmetadata">Posted in <?php the_category(', '?> | <?php edit_post_link('Edit'''' | '); ?>  
      <?php comments_popup_link('No Comments »''1 Comment »''% Comments »'); ?></p>
    </div>
  <?php endforeach; ?>
  
  <?php else : ?>
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    
 <?php endif; ?>

</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
pero no ha funcionado