1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Random page content displayed on homepage

Discussion in 'Content Management' started by Camay123, Mar 11, 2009.

  1. #1
    What is the code or wordpress tag, to display one random page content on a wordpress blog ?
     
    Camay123, Mar 11, 2009 IP
  2. Big0ne

    Big0ne Well-Known Member

    Messages:
    2,614
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    165
    #2
    You would need to edit index.php located in your Wordpress theme folder.

    This should work:

    	<?php $featured = new WP_Query("orderby=rand"); ?>
         
    	 <?php if ($featured->have_posts()) :  ?>
    
    	 <?php while ($featured->have_posts()) : $featured->the_post(); ?>
    PHP:
    If you need additional help on this let me know.
     
    Big0ne, Mar 14, 2009 IP