<?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
5 hosting control panels available on the market
cPanel This Linux based control panel is placed in the first category of control panels due to its high popularity and professional features with easy operations. It has a simple and understandable GUI, awarding it our recommendation for Linux-based web...
0
0
8
WordPress next post / previous post on the same category
<?php $current_category=get_the_category(); $prev_post = get_previous_post($current_category,”); $next_post = get_next_post($current_category,”); ?> <div class=”previous_post_link fl”> <?php if (!empty( $prev_post )): ?> <a href=”<?php%20echo%20get_permalink(%20$prev_post->ID%20);%20?>”><?php echo get_the_post_thumbnail( $prev_post->ID, ”, ” ); ?></a> Pre: <a href=”<?php%20echo%20get_permalink(%20$prev_post->ID%20);%20?>”><?php echo $prev_post->post_title; ?></a> <?php endif; ?> </div> <div class=”next_post_link fr”>...
0
0
13
WordPress Add Login/Logout Links Using a Plugin
Add Login/Logout Links Using a Plugin One of the simplest ways to manage login/logout links is by using a plugin. Many plugins are designed specifically for this purpose. Here’s how you can do it: Install a Plugin: Go to your...
0
0
14
WordPress displays subcategories of the current category
When making a corporate website, you need to list the corporate product categories in the sidebar of the website. If the company website has many product items, you need to set up secondary categories or subcategories. How to display subcategories...
0
0
20
Comments (0)