Add random post button in WordPress

To add a rondom post button in WordPress:

  1. Make a copy of 【page.php】 file to alter.
  2. Rename 【page.php】  that we just copied to 【page-random.php】.
  3. Open up 【page-random.php】 and paste following code before 【get_header();】 paragraph:
  4. Go to WP【Dashboard】-【Pages】-【Add New】 to add a new page, name the title as you want. Then select the 【Template】 to 【Random Post】 and click on 【Publish】. And this is the page that can bring visitor redirect to a random post. Try it now!~

 

</catmee> 文章全部原创、谢绝转载,作者「BianLei」,如果喜欢欢迎分享链接,相关内容参见本站版权声明
本站相关:哔哩哔哩 | QQ空间 | YouTube ★★★ 打赏:支付宝 ★★★
Tagged . Bookmark the permalink.

Comment Anonymously? No Problem! | 可以匿名评论了我会说?

Fill up Email address to subscribe reply and display your avatar from Gravatar (If any)
填写邮箱即可显示您在Gravatar的头像