WordPress.org

Ready to get started?Download WordPress

Forums

Random Excerpt outside of WP (5 posts)

  1. oriecat
    Member
    Posted 10 years ago #

    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, '

  2. ', '
  3. '); ?>
    <?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 :)

  • Mark (podz)
    Support Maven
    Posted 10 years ago #

    I love your blog !!!
    Random image .. just use CSS ? and a small script ?
    http://weblogtoolscollection.com/archives/2004/04/17/random-image-header/

  • oriecat
    Member
    Posted 10 years ago #

    Thanks podz :)
    I will try that...

  • oriecat
    Member
    Posted 10 years ago #

    Well I got that to work and I've got it up for now, but...
    1) I would like the thumbnail to link to the whole post, in case people wanted to see that image bigger
    and
    2) Since my thumbnails are in multiple folders (due to how Pictorialis II is set up), I had to just pic a folder to put the script in, thereby limiting the random choices.
    So is there any other way to go about this?

  • winpoka
    Member
    Posted 8 years ago #

    I believe I'm looking for a similar plugin.

    Are there any WP 2.0 Compatible "random excerpt" plugins available out there?

    I'd simply like to show a random excerpt from each of my posts on every pageload. Thanks!

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags