One of the reasons why I like the idea of having a random posts link is because it allows visitors opportunities to discover posts that they might not necessarily find because they’re not on the front page.
I also think it’s pretty cool to be able to click a link and see where I end up. I’ve always wanted to make one of my own, but I didn’t know how until recently.
Now that I know however, I’d like to share that information here just in case you also have a blog and have been wanting to know how to do it yourself.
Another reason why I like this option that I’m sharing is because you could use it without having to install a plugin to get the job done, making this option accessible to bloggers whether their websites are self-hosted or not.
How to make a random posts link in your blog or website
To create a url for random posts on your blog, just type in:
http://yourwebsiteaddress.com/?random
where “yourwebsiteaddress.com” is your actual web address.
So for me, my random posts url would be:
http://relandothompkins.com/?random. Using that formula, what would yours be?
To hyperlink it into some text, use:
<a href="http://yourwebsiteaddress.com/?random">insert whatever descriptive text you want here</a>
To create a button, you can upload whatever picture you want to use for the button, get the url for that picture, and put that url into this code. The descriptive text in this particular code is “click for random post”, but you can change that and call it whatever you want:
<img src="URL_of_button" alt="click for random post" title="random button" />
If you’d like to place a random post link into your sidebar, you can also use these same codes, entering the information specific to your site into a text widget.
If you’re embedding the link within an individual blog post, you can also highlight the text and hyperlink it to your random posts url.
You can display the actual link itself: http://relandothompkins.com/?random
or you can write descriptive text, highlight it, and place the link within that text
with the result being:
Check out this link to learn more.
Now when visitors click on the text that you’ve highlighted and selected, they will be taken to wherever you made the link to, which in this case would be a random post.
Note: When doing this, you can decide whether or not you want the link to lead to a new tab by selecting the box that appears after you hit the link button.
For the sake of this particular post, I have my links starting in a new tab to give you an idea of how it works, but for my own purposes I generally have this type of link open in the same window.
Introducing (N.A.H) Shuffle
I’ve now placed my own random posts links in my sidebar. One is contained in a link below my site logo and social media handles near the top of my sidebar.
It says (N.A.H.) Shuffle: Visit a Random Note.
I’ve attached the other to a button in the form of a shuffle symbol just below my most visited posts for the day:
You can click either of these links: the (N.A.H.) Shuffle text near the top , or the shuffle symbol under the day’s most visited notes in my sidebar anytime to be taken to a random note.
If you’re interested, try this out on your own blog or website.
From Aspiring Humanitarian, Relando Thompkins, MSW
—————————————————————————————————————————
(N.A.H.) is advertisement-free and reader supported. If you enjoy my notes, consider supporting (N.A.H.) with a one-time donation or by becoming a monthly patron.
—————————————————————————————————————————
Discover more from Notes from an Aspiring Humanitarian
Subscribe to get the latest posts sent to your email.
This doesn’t work with blogger. How do I show random posts in blogger?
Hello Windsprite,
Unfortunately this tutorial is wordpress specific. I do not have the same level of experience with blogger as I do with wordpress. However, I do know that there are tutorials regarding how to install a random post widget for people who use the blogger platform.
A very belated thank you! I put one of these links on my WordPress blog maybe a year ago, and by all indications, visitors are prowling around a lot more.
You’re very welcome! Glad to hear it!