<?php
$rand_posts = get_posts(‘numberposts=10&orderby=rand’);
foreach( $rand_posts as $post ) :
?>
<li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
<?php endforeach; ?>
wordpress display random articles
Related Articles
WordPress-How to show single post content in front-end?
WordPress-How to show single post content in front-end? <?php if(have_posts()) : while (have_posts()) : the_post(); the_title(); echo ‘<div class=”entry-content”>’; the_content(); if(get_post_meta($post->ID, ‘key-name’, true)){ echo get_post_meta($post->ID, ‘key-name’, true); } echo ‘</div>’; endwhile; endif; ?>
0
0
6
WordPress Tutorial-Keep secure and back up
To get the best out of what software has to offer it’s important to make sure you’re using the most up to date version of WordPress. Many of the WordPress sites that get hacked have not updated to the latest...
0
0
10
What to do if the WordPress blog changes the site address (URL) and cannot log in?
When you change the site address of the wordpress program and save the settings, if you find that you wrote the wrong address and want to change it, you will find that you can’t log in at all. You may...
0
0
18
WordPress Custom Post Types
Custom Post Types in WordPress are a powerful feature that allow you to create different types of content beyond the default posts and pages. This can be especially useful if you want to manage various types of content in a...
0
0
28

Comments (0)