Random post from database
-
Hi,
I searched a lot but I cant seem to find the right solution. What I would like is to show complete random full posts to each visitor from my database. Not only the title (I did see plugins for that)
I am using the following code right now (in index.php)
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”entry”>
<h1 id=”post-<?php the_ID(); ?>”>” rel=”bookmark”><?php the_title(); ?></h1>
<div align=”left”><?php the_content(‘Read the rest of this entry »’); ?></div>
<div class=”info”>
<p class=”infoleft”><?php if ( the_tags(‘Tagged with ‘, ‘, ‘) ) ?></p>
<p class=”inforight”> <?php edit_post_link(‘Edit’); ?></p>
<br clear=”all” />
</div>
<?php if ( comments_open() ) comments_template(); ?>
</div>
<?php endwhile; else: ?>
<div class=”entry”>
<p><b>Sorry, but you are looking for something that isn’t here.</b></p>
</div>
<?php endif; ?>thanks!
The topic ‘Random post from database’ is closed to new replies.