• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Genesis CPT Archive Settings: Not Working?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Genesis CPT Archive Settings: Not Working?

This topic is: resolved

Tagged: Custom Post Type, genesis archive settings

  • This topic has 1 reply, 1 voice, and was last updated 9 years, 7 months ago by Joe.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 10, 2014 at 3:42 pm #89704
    Joe
    Member

    I just started into this new to 2.0 feature, but I can't get it to work at all. I've even tried on a fresh local install, running just Genesis and the AgentPress theme. No other plugins.

    I'm just adding in the genesis-cpt-archive-settings feature to the 'supports' array; as far as I can tell, that's all you need, right? Beyond setting has_archive and public to true.

    It doesn't show up in the menu.

    I thought maybe it was because I was registering my CPT in a functionality plugin, so I ripped it out out of there, dropped it straight into functions.php, and de-activated my functionality plugin. Same behavior.

    I've even tried not declaring it during the initial registration, and writing a separate function to add it in.

    Anyone else seen this behavior or see what I'm missing?

    Here's the CPT declaration that I'm using:

    // Register CPT
    function jra_register_directory_post_type() {
    	$labels = array(
    		'name'               => _x( 'Directory', 'post type general name' ),
    		'singular_name'      => _x( 'Person', 'post type singular name' ),
    		'add_new'            => _x( 'Add New', 'person' ),
    		'add_new_item'       => __( 'Add New Person' ),
    		'edit_item'          => __( 'Edit Person' ),
    		'new_item'           => __( 'New Person' ),
    		'all_items'          => __( 'All People' ),
    		'view_item'          => __( 'View Person' ),
    		'search_items'       => __( 'Search People' ),
    		'not_found'          => __( 'No people found' ),
    		'not_found_in_trash' => __( 'No people found in the Trash' ), 
    		'parent_item_colon'  => '',
    		'menu_name'          => 'Directory'
    	);
    
    	$args = array(
    		'labels' => $labels,
    		'description' => 'All people associated with the organization.',
    		'public' => true,
    		'exclude_from_search' => false,
    		'publicly_queryable' => true,
    		'show_ui' => true,
    		'show_in_nav_menus' => true,
    		'show_in_menu' => true,
    		'show_in_admin_bat' => false,
    		'menu_position' => 10,
    		'menu_icon' => 'dashicons-groups',
    		//'capability_type' => '',
    		//'capabilities' => '',
    		//'map_meta_cap' => false,
    		'hierarchical' => false,
    		'supports' => array( 'title', 'revisions', 'genesis-cpt-archive-settings' ),
    		//'register_meta_box_cb' => '',
    		//'taxonomies' = array(),
    		'has_archive' => true,
    		'rewrite' => true,
    		'query_var' => true,
    		'can_export' => true
    	);
    	
    	register_post_type( 'directory', $args );
    	
    }
    add_action( 'init', 'jra_register_directory_post_type' );
    February 10, 2014 at 3:46 pm #89705
    Joe
    Member

    Well........
    This is rather embarrassing. A very minor typo that I missed was causing the issue.

    The supports arg is genesis-cpt-archives-settings not genesis-cpt-archive-settings.

    Hopefully some part of this post helps someone in the future at least.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble