Random Excerpt outside of WP
-
I would like to have a random thumbnail show up on my main page (https://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('https://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 ??
- The topic ‘Random Excerpt outside of WP’ is closed to new replies.