Tutorial:Random post option in wordpress…

Discussion in 'WordPress' started by adithya, Apr 9, 2008.

  1. #1
    Wanna create a Random post option in your wordpress blog just like Random article option in Wikipedia…..?

    [​IMG]

    Then read this small tut…..

    * In order to have random post or Random article facility in the wordpress powered blogs,you need to download the Random Redirect plugin.
    Link: http://downloads.wordpress.org/plugin/random-redirect.zip

    *Activate the plugin

    *The plugin will create a link to blogurl/?random which will redirect to a random post of your blog.For example in case of my blog the link will be http://blog.aditech.info/?random Now we have to create make use of this link. This method will differ from theme to theme but the important point is the random post will be given at the link blogurl/?random.In almost all the themes there will be nav_menu.php file.Edit this file in the Theme editor and add the following lines

    
    <li><a <?php if (is_page('?random')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/?random">Random post</a>
    
    Code (markup):
    That’s it…:)
    Hope you liked this small tutorial…:)

    Source
     
    adithya, Apr 9, 2008 IP
  2. pixeladd

    pixeladd Banned

    Messages:
    2,238
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #2
    thanx very much

    seen something like this before and cudnt find it

    rep
     
    pixeladd, Apr 9, 2008 IP
  3. adithya

    adithya Well-Known Member

    Messages:
    568
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    110
    #3
    ^^You are welcome...:)
     
    adithya, Apr 10, 2008 IP
  4. godsofchaos

    godsofchaos Peon

    Messages:
    2,595
    Likes Received:
    124
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Cool tutorial... you can also try a plugin like simple tags or if you liked that ;)
     
    godsofchaos, Apr 10, 2008 IP