Quick question about Custom Post Types:
To get the label of a post, i use:
<?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->label; ?>
But is it possible to get that label as a link to all posts posted under that label? (did that sentence make sense?)
To give an example what I’m looking for. I got a Custom Post Type named news-entry and label News. On the start page i only show the 5 recent posts of that Custom Post Type. And I want to implement a link, that shows all posts under that current Custom Post type:
Figure the output would be:
<a href="link-to-all-posts-under-this-label">Show all posts from <?php echo $post_type->label; ?></a>
Am I thinking about this the right way?
- The topic ‘Show all posts from current Label using Custom Post Types’ is closed to new replies.