<?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 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
11
How To Add Pagination To WordPress
Step 1: Put the following code into the template function file functions.php of the WordPress theme you are using. function kriesi_pagination($query_string){ global $posts_per_page, $paged; $my_query = new WP_Query($query_string .”&posts_per_page=-1″); $total_posts = $my_query->post_count; if(empty($paged))$paged = 1; $prev = $paged – 1;...
0
0
10
WordPress displays articles in a specified category
<?php $posts = get_posts( “category=4&numberposts=10″ ); ?> <?php if( $posts ) : ?> <ul><?php foreach( $posts as $post ) : setup_postdata( $post ); ?> <li> <a href=”<?php the_permalink() ?>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></a> </li> <?php endforeach; ?> </ul>...
0
0
21
How to Create a Blog Page on WordPress
Creating a blog page on WordPress is a straightforward process that allows you to publish and manage your content easily. Here’s a step-by-step guide to help you set up a blog page on your WordPress site: Step 1: Log in...
0
0
30

Comments (0)