Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $posts = $wpdb->get_results('SELECT * FROM wp_posts WHERE ID IN(SELECT post_id FROM wp_postmeta WHERE meta_key="territories" AND meta_value='.$post->ID.') ORDER BY post_date DESC LIMIT 5');
- if(empty($posts)){
- echo 'The Monkey Rats have aborted...';
- }else{
- foreach($posts as $post){
- setup_postdata($post);
- ?>
- <li>
- <h3><a href="<? the_permalink() ?>"><? the_title() ?></a></h3>
- </li>
- <?
- }
- }
- ?>
Add Comment
Please, Sign In to add comment