<?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
How to display the latest article in wordpress
When you make your own website, the homepage needs to display the latest articles on the website. How to make the website automatically display the articles on the website background? You need to add the latest article in wordpress. There...
0
0
0
WordPress Customize the theme to create basic files-Style.css
In /wp-content/themes/, create a folder called my-custom-theme and create the following two files: style.css In order for WordPress to recognize our theme and output it correctly in the Appearance → Theme list, we need to put some WordPress specific code...
0
0
0
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
1
WordPress display the latest comment
WordPress display the latest comment <?php global $wpdb; $sql = “SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,30) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = ’1′ AND comment_type...
0
0
0
Comments (0)