• I’m trying to add a random topics code but i’m having problem.

    The problem is when i add the script it works properly but it destroys first recent topic beneath it.

    tihs is the random script

    <?php
     $rand_posts = get_posts('numberposts=5&orderby=rand');
     foreach( $rand_posts as $post ) :
     ?>
    
    <li><a>">
            <?php the_title(); ?>
            </a></li>
          <?php endforeach; ?>

    under 5 random posts, there is my recent posts (sidebyside)

    <div class="entrybody">
    								<?php if (is_archive() || is_search() || is_home()) : ?>
    <div id="container_division">
    
    <div class="post-block">
    <div class="boxtop"> </div>
    <div class="inner">
    <div align="left"><a title="<?php the_title(); ?>" style="font: bold 13pt Arial;  color:#CC0000;" href="<?php the_permalink() ?>"><?php the_title(); ?></a></div>
    <div class="thumb"><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php echo  ilk_resmi_al();?> " width="100px" height="90px" /></a></div>
    <?php the_excerpt(); ?>
    </div>
    <div class="boxbottom"> </div>
    
    </div>
    
    </div>

    to see the problem plase click on http://www.okuogren.com and in the middle of the page there is a box in the center it’s named “KPSS 2010”. There are five random posts… and just below notice the first recent post, you’ll see that 5th random post and the first general recent post are the same… i think the random script cannot finalize it’s query and affect the other recent posts. When i use it on sidebar no problem. also there is problem with popular, related, commented posts it’s because it is above the recent posts. When i try to include related script under content at this time Comment box doesn’t show up and says closed to comment…

    <?php
     $rand_posts = get_posts('numberposts=5&orderby=rand');
     foreach( $rand_posts as $post ) :
     ?>
          <li><a href="<?php the_permalink(); ?>">
            <?php the_title(); ?>
            </a></li>
          <?php endforeach; ?>

    TO FINILAZE or to keep it effect other posts whan can i do? thx for help

  • The topic ‘random script mess it up’ is closed to new replies.