I am trying to create a breadcrumb style link back to the archive/feed page for each of my custom post types, for a magazine style website, preferably without having to make a separate template for each post type as there are a few. (I'm also hoping to be able to use the same breadcrumb style link on my main feed in a featured posts kind of way. EG above each H1 of each featured post, so that if somebody clicked fashion instead of the H1 it would take them through to that archive page, as another way of browsing the site as opposed to having to use the top level menu nav.)
Using the following:
$postType = get_post_type_object(get_post_type()); if ($postType) { echo ''; echo esc_html($postType->labels->name); echo ''; } the_title('', '');
Stackoverflow has stripped the HTML parts from the above code, not sure what I'm doing wrong there
It is correctly pulling and displaying the name of the post type, eg 'Fashion', however the link returned is for the current post, not the feed page.
has_archive and hierarchical are both set to true when creating post type and I've updated permalinks. Anybody have a solution?