WordPress has a very cool feature which allows the author to showcase a random post on the blog. All one needs to do is add ?random to the end of the wordpress URL. Thus, for this site the link is
http://fasterthanlight.wordpress.com/?random
Putting the above url in the title bar will result in any random post being picked and displayed. So, at first I put in a link for the above in my sidebar. It serves the purpose but doesn’t look chic. So I tried to make a button for the link. But, the button tag is not allowed in wordpress. The list of Allowed HTML tags on WordPress blogs can be viewed here. So, But I still had one cool option left. The table tag is allowed here. So I created a ‘button’ for the same.
Here’s my code:
<div id=”gmdp”>
<div id=”tx1.”>
<table id=”cen-” style=”color:#000000;height:32px;” border=”1″ cellspacing=”2″ cellpadding=”3″ width=”160″ bgcolor=”#eeeeff”>
<tbody>
<tr>
<td style=”padding-left:10px;” width=”100%”><span style=”font-size:105%;”><a title=”Opens a Random Post on this WebLog…” href=”http://fasterthanlight.wordpress.com/?random” target=”_self”>Read a Random Post</a></span></td>
</tr>
</tbody></table>
</div>
<span style=”font-size:110%;”> </span></div>
Get this Button Now:
For using a similar button on your site, you simply need paste the above code as a text widget in your sidebar. Select the whole code and choose the ‘copy‘ option. Then go to the ‘Widgets‘ page under ‘Design‘ for your blog. Choose your ‘sidebar‘ and insert the widget ‘text‘.In the ‘Text Edit‘ section just ‘paste‘ this code in the space provided. Replace fasterthanlight with your blog’s domain name! Click on ‘Save Changes‘. Done!:-)
Isn’t that easy? If you want to modify various parameters like button size, background color, font options, hover options, etc. just type in your issue as a comment to this post. I’ll get back to you asap.
Thank you for reading this post. Your comments, pingbacks, ratings, reviews and any other contributions are greatly appreciated.
Filed under: Cool Hacks, Tweaks, Tips & Tricks, Wordpress






[...] Excerpted from:WordPress Blog Random Post Button In Sidebar [...]
Hi I like this site im glad you updated it . I like the new options.
varcli
Your site displays incorrectly in Mozilla, but content excellent! Thanks for your wise words =)
Hello !!!!
My name is Piter Kokoniz. Just want to tell, that your blog is really cool
And want to ask you: what was the reasson for you to start this blog?
Sorry for my bad english:)
Thank you!
Your Piter
[...] Last but not least add a random post button wherever you think it’s most appropriate. Once I get to a new site and read something [...]
You have very good site!
Peccare licet nemini!
To be more modest it is necessary
You have kept away from conversation
Great site…keep up the good work.
Excellent site, keep up the good work