Display posts using custom taxonomy tags
-
I have created template pages which I want to be filled in by the use of posts identified by tags. Works perfectly by using
global $post; $postsByTag = get_posts('tag=hnwtag&numberposts=4'); foreach($postsByTag as $post) { setup_postdata($post); echo '<a href="'. get_permalink().'">'. get_the_title().'</a><br />'.get_the_excerpt().'</a><br />'; } if (have_posts()) : while (have_posts()) : the_post(); endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?>
I don’t want loads of tags messing up tag clouds, though, so have created a new taxonomy to deal with this, but how can I display the post contents in my template pages via this new taxonomy? Been on this for HOURS!!! Any pointers GREATLY appreciated!!! The new taxonomy is called ‘profile’, and has tags in it including ‘name’ and ‘school’.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display posts using custom taxonomy tags’ is closed to new replies.