insert a random link between index article
-
Is possible show a random link every a random number in the main index….for example, i show 12 article in the index, i would put a link one time after post 2, sometime after post 7, sometime after post 11, randomly.
I’ll put in the link some of my sponsor
This is my code
<?php $wp_query->query_vars[“cat”] = 11; ?>
<?php $wp_query->query_vars[“showposts”] = 12; ?>
<?php $wp_query->get_posts(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?><div class=”post”>
” rel=”bookmark”><?php the_excerpt(); ?>
<h1 class=”story_title” id=”post-<?php the_ID(); ?>”>” rel=”bookmark”><?php the_title(); ?></h1>
<p class=”date”><?php the_time(‘m-j-y’); ?></p>
</div>
<?php endwhile; else: ?>
<h2>Not Found</h2>
<p><?php _e(“Sorry, but you are looking for something that isn’t here.”); ?></p>
<?php endif; ?>`
The topic ‘insert a random link between index article’ is closed to new replies.