Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $post;
- $categories = get_the_category();
- foreach ($categories as $category) :?>
- <ul>
- <?php
- $posts = get_posts('numberposts=3&category='. $category->term_id);
- foreach($posts as $post) : ?>
- <li>
- <a href="<?php the_permalink(); ?>">
- <?php the_title(); ?>
- </a> </li>
- <?php endforeach; ?>
- <?php endforeach; ?>
- </ul>
- <?php
- $currentPostID = $post->ID;
- global $post;
- $categories = get_the_category();
- foreach ($categories as $category) :?>
- <ul>
- <?php
- $posts = get_posts('numberposts=3&category='. $category->term_id);
- foreach($posts as $post) : ?>
- <?php if ($currentPostID != $post->ID) {
- $test_value = get_post_meta( $post->ID, 'test', true );
- ?>
- <li>
- <a href="<?php the_permalink(); ?>">
- <?php if ( ! empty( $test_value ) ) {echo $test_value; } else { echo 'Nothing'; } ?>
- </a>
- </li><?php
- }?>
- <?php endforeach; ?>
- </ul>
- <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement