Tonny Kluften
Administrator
Begge disse to kodesnuttene skal vise tilfeldige poster, men det gjør de ikke, noen som har peiling på hva som kan forstyrre?
<?php
$args = array( 'numberposts' => 6, 'orderby' => 'rand' );
$rand_posts = get_posts( $args );
foreach( $rand_posts as $post ) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
<?php
$rand_posts = get_posts('orderby=rand&cat=130&numberposts=6');
foreach( $rand_posts as $post ) :
?>
<a href="<?php the_permalink(); ?>" title="<?php the_title() ?>"><?php the_title(); ?> </a><?php the_excerpt(); ?>
<?php endforeach; ?>
<?php
$args = array( 'numberposts' => 6, 'orderby' => 'rand' );
$rand_posts = get_posts( $args );
foreach( $rand_posts as $post ) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
<?php
$rand_posts = get_posts('orderby=rand&cat=130&numberposts=6');
foreach( $rand_posts as $post ) :
?>
<a href="<?php the_permalink(); ?>" title="<?php the_title() ?>"><?php the_title(); ?> </a><?php the_excerpt(); ?>
<?php endforeach; ?>
