Code for Random Posts

Pendem RajuBlogging0 Comments

This Javascript code takes your blog or website feeds as input and displays random post titles. Adding this code to your blog or website is pretty easy. Whenever user visits your website he/she will see some random post titles of your blog. Thus if user finds any interesting post title he/she clicks on it and reads that post too. Thus increases user engagement on your blog or website.

Code for Random Posts

Blogger Bloggers go to your blogger dashboard, click on layout, add a HTML/Javascript gadget, paste the following code and lastly click on save.

WordPress bloggers from your dashboard under Appearance click on Widgets. Drag a Text widget to your desired widget area, paste the following code and click on save. Others you can copy the code wherever you want on your website in a HTML editor.

In the above code 8 represents no of post titles you can replace it with your desired number. For example you can see some random post titles in my blog as shown in below pic when you refresh the page you can see the change in post titles. This feature is currently disabled in my blog.

code for random posts

Conclusion

If you want to increase user engagement on your blog it is always good to display some popular or random posts on your blog. Increased user engagement means less bounce rate which is a good sign for a blog. If you liked our post you would be doing a huge favour by sharing our post on Facebook and twitter and leaving us a comment to let us know what you think.

Leave a Reply

Your email address will not be published. Required fields are marked *