stephenharris / WordPress-Post-Type-Archive-Links

Adds a metabox on Appearance > Menus to create menu items pointing to post type archives
55 stars 25 forks source link

Post Type Archive Link

Contributors: stephenharris, F J Kaiser, ryancurban, giuseppe.mazzapica
Tags: post type archives, menu link, archives, navigation, metabox, administration user interface
Requires at least: 3.3
Tested up to: 4.1.1
Stable tag: 1.3.1
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl.txt

Creates a metabox to the Appearance > Menu page to add custom post type archive links

Description

Post Type Archive Link creates a metabox on the Appearance > Menu admin page. This lists your custom post types and allows you to add links to each archive page in your WordPress menus.

The plug-in uses WordPress' default menu classes for current pages, current page parent and current page ancestor.

By default all post types with archives (and not registered by core) are available for adding to your menu. You can forcibly revent a particlar post type from appearing using the show_{$posttype}_archive_in_nav_menus hook.

Installation

Installation is standard and straight forward.

  1. Upload WordPress-Post-Type-Archive-Links folder (and all it's contents!) to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. The metabox will appear at the bottom of your Appearance > Menu

Frequently Asked Questions

I can't see in the 'post type' metabox on the Apperance > Menus screen

View the "screen options" (top right), and ensure that "Post Type Archives" is checked.

Why are some post types missing?

The metabox will only list custom post types registered with non-falsey has_archive, publicly_queryable or show_in_vav_menus.

CPTs having true has_archive' but falsepublicly_queryableand/orshow_in_vavmenuscan be shown usingshow{$cpt_slug}_archive_in_nav_menus` filter hook.

Screenshots

1. Custom post types admin menu metabox

Custom post types admin menu metabox

2. Custom post types added to your menu

Custom post types added to your menu

3. Custom post type 'Clients' in front-end menu with WordPress menu classes and current item styles

Custom post type 'Clients' in front-end menu with WordPress menu classes and current item styles

Changelog

1.3.1 - 12th April 2015

1.3

1.2

1.1

1.0.1

1.0