Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $this_post = $post;
- $category = get_the_category(); $category = $category[0]; $category = $category->cat_ID;
- $posts = get_posts('numberposts=6&offset=0&orderby=post_dat e&order=DESC&category='.$category);
- $count = 0;
- foreach ( $posts as $post ) {
- if ( $post->ID == $this_post->ID || $count == 5) {
- unset($posts[$count]);
- }else{
- $count ++;
- }
- }
- ?>
- <?php if ( $posts ) : ?><h3>Artikel Terkait :</h3><ul><?php foreach ( $posts as $post ) : ?>
- <li>
- <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li><?php endforeach // $posts as $post ?></ul>
- <?php endif // $posts ?>
- <?php $post = $this_post;
- unset($this_post);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment