Sunday, September 25, 2016

How to Make Random Post in Wordpress

How to Make Random Post in Wordpress


How to Make Random Post in Wordpress - random post is a widget that show some post with random article, this is step to showed to visitor the article maybe they need it. today AA Tech will explain for you how to make random post in wordpress.

How to Make Random Post in Wordpress
How to Make Random Post in Wordpress

to make random post in wordpress, you can follow this step:

=> login to your account

=> open sidebar.php in your template

=> submit this code:

<ul><?php $rand_posts = get_posts(‘numberposts=5&orderby=rand’); foreach( $rand_posts as $post ) :
?><li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li><?php endforeach; ?></ul>

=> note: Numberposts: max article that show

=> save your template.

ok finished, now you can see the random post in your blog, thank you because you read this article. you can see article "How to make Recent Post in Wordpress" and "How to Make Popular Post in Wordpress". that is my article before posted this article.

Go to link Download

No comments:

Post a Comment