WordPress.org

Support

Support » Plugins and Hacks » Random Excerpt outside of WP

Random Excerpt outside of WP

  • I would like to have a random thumbnail show up on my main page (http://moltenwords.net) I just inserted an image there, but I would like it to randomize. I installed and activated the Random Excerpt plug in. I got it to work inside my pages, but I cannot get it to work on this index. I put require wp-blog-header and the loop in there, but nothing.
    Here’s what I added:
    in the header:
    <?php
    /* Don't remove this line. */
    require('http://moltenwords.net/picto/wp-blog-header.php');
    ?>

    in the body:
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php random_excerpt(1, '

  • ', '
  • '); ?>
    <?php endforeach; else: ?>
    <?php endif; ?>

    I am sure I forgot something stupid. What other code would I need to put in my index so that it will pull the random excerpt from the database? Thank you 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Random Excerpt outside of WP’ is closed to new replies.
Skip to toolbar