Pro Tip: How to Make a Random Posts Link in Your Blog or Website

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

visual_link1

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.

open-link-new-window-tab-wordpress

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:

button_shuffle_icon

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.

Ubuntu,

From Aspiring Humanitarian, Relando Thompkins, MSW

—————————————————————————————————————————

—————————————————————————————————————————

Get New Notes in Your Inbox

Enter your email address to have new notes delivered to your inbox.

Written by

I'm a Social Justice Educator and Aspiring Humanitarian who is interested in conflict resolution, improving intergroup relations, and building more equitable and inclusive communities. "Notes from an Aspiring Humanitarian" is my blog, where I write about issues of diversity, inclusion, equity, and social justice. By exploring social identities through written word, film & video, and other forms of media, I hope to continue to expand and enrich conversations about social issues that face our society, and to find ways to take social action while encouraging others to do so as well in their own ways.

Still Here? Try these...

2 Responses

  1. Windsprite says:

    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.

Share Your Thoughts: Leave a Comment

%d bloggers like this: