Tuesday, November 1, 2016

Quick Tip: Add Archive Pages to the WordPress Menu Builder

When you create new content types with add_post_type you can specify if you want your individual post items to be accessible via the WordPress menu builder, giving you quick access to link to your single post.

It’s a pretty useful feature and all you need to do to take advantage of it is to specify that the add_to_menu property is set to true. What’s not so easy is if you wanted to link directly to your post types archive page.

[caption id="attachment_142576" align="aligncenter" width="637"]archive page plugin Creating a simple interface for your archives.[/caption]

By default WordPress doesn’t provide an easy way to to link to your post type archives. This makes sense as internally WordPress handles the post content type as your blog (controlled by your site’s reading settings) and the page content type doesn’t require an archive page. However, if we have custom post types it would be great to have them as menu items so it’s easy to link to them (without having to rely on using the custom menu elements).

Continue reading %Quick Tip: Add Archive Pages to the WordPress Menu Builder%


by Simon Codrington via SitePoint

No comments:

Post a Comment