How to show post 5 t/m 10 (by random?)
I’m sorry, but I’m not sure what the abbreviation t/m means.
How to exclude a category id?
query_posts(array('category__not_in' => array(17)));
excludes category 17
i mean how to show post 5 until post 10
because i have on the frontpage post 1 until 5.
And how to add your query into my post query?
(this one:)
<?php query_posts('showposts=5&random=true');?>
how to add your array into this?
i mean how to show post 5 until post 10
5-10: that’s 6 posts. And to start with the 5th you need to offset by 4:
query_posts(array(
'showposts' => 6,
'offset' => 4,
'random' => true,
'category__not_in' => array(17),
));
Thank you filosofo! You rock!
only, one small problem, it’s not random anymore. I think it’s because the value is set by 4.
But it must be random to (for example post 4 – 9999)
Hey filosofo, i got it!
I have now created this code:
<div id="mpu_test1">
<?query_posts(array(
'showposts' => 4,
'offset' => 9,
'random' => true,
'category__not_in' => array(95,145,226),
));?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div>
<table width="100%" border="0">
<tr>
<td><img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo get_post_meta($post->ID, "image", $single = true); ?>&h=57&w=100&zc=1&q=95" alt="<?php the_title(); ?>" class="th" /> </td>
<td><?php the_title(); ?></td>
</tr>
</table>
</div>
<?php endwhile; else: ?><p>Oops, no posts!</p><?php endif; ?>
but that gives this output:
(see screenshot)
http://i44.tinypic.com/20fxrn6.jpg
How to make the results right under each other?
Instant of this?:
– item
– item
– item
– item