Custom field order breaks after 5th post
-
Hi! I’m using custom fields to sort all my post o a custom page template. Everything works great until more than 5 posts are being displayed.
The custom field i’m using is called “ordning”.
Here’s the code:
<ul class="indexbox"> <?php $recent = new WP_Query("cat=0&showposts=0&orderby=meta_value&meta_key=ordning&order=DESC"); while($recent->have_posts()) : $recent->the_post();?> <li> <?php if ( get_post_meta($post->ID, 'thumb', true) ) : ?> <a href="<?php the_permalink(); ?>"><img src="lib/<?php echo get_post_meta($post->ID, 'thumb', true) ?>" /></a> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <?php if ( get_post_meta($post->ID, 'beskrivning', true) ) : ?><div class="beskrivning-display"><?php echo get_post_meta($post->ID, 'beskrivning', true) ?></div><?php endif; ?> <?php endif; ?> </li> <?php endwhile; ?> </ul>
Any ideas what the problem could be? I’m using WordPress 3.1.1.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom field order breaks after 5th post’ is closed to new replies.