Releted post problem
-
hey,
i have related posts widget on my website that appear at the bottom of an article, but in the description of every post i have the description of the current post (in single.php)
how can i resolve this?
my code:
<?php $posts = get_posts('orderby=rand&numberposts=3'); foreach($posts as $post) { ?> <div class="article"> <?php the_post_thumbnail(); ?> <a href="<?php the_permalink(); ?>"><span style="font-weight: bold;height: 32px;padding: 5px;float: right;"><?php the_title(); ?></span></a> <span style="padding: 5px;height: 62px;overflow:hidden;float: right;"><?php the_excerpt(); ?></span> <div class="details"> <span style="width: 110px;float: left;"><img align="absmiddle" style="float: right;margin-left: 5px;" src="<?php echo get_template_directory_uri(); ?>/img/tinyicon1.png"/><?php the_category(' '); ?></span> <span style="float: right;"><img align="absmiddle" style="float: right;margin-left: 5px;" src="<?php echo get_template_directory_uri(); ?>/img/tinyicon2.png"/><?php comments_popup_link( '<span class="leave-reply">' . __( '0 תגובות', 'twentyeleven' ) . '</span>', __( 'תגובה 1', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> </div> <div class="tinydate"><?php the_time('d/m/y G:i') ?><?php edit_post_link( __( '<img src="http://www.sbdrecipes.com/images/editIcon.gif" width="13" height="13" alt="" />', 'twentyeleven' ), '' ); ?></div> </div> <?php } ?>
i think the description is this :
<?php the_excerpt(); ?>
demo: (in hebrew, forgive me)
http://weird.co.il/2013/09/08/7-%D7%A1%D7%99%D7%91%D7%95%D7%AA-%D7%9C%D7%9E%D7%94-%D7%91%D7%A8%D7%95%D7%A1-%D7%9C%D7%99-%D7%94%D7%99%D7%94-%D7%94%D7%92%D7%93%D7%95%D7%9C-%D7%9E%D7%9B%D7%95%D7%9C%D7%9D/
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Releted post problem’ is closed to new replies.