• 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

Post Meta not appearing on custom post types

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 › Post Meta not appearing on custom post types

This topic is: not resolved

Tagged: Custom Post Type, post meta not showing

  • This topic has 1 reply, 1 voice, and was last updated 9 years, 1 month ago by David Borrink.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • October 4, 2016 at 8:17 pm #194240
    David Borrink
    Participant

    I have added a custom post type called "news" to a site, and also a custom taxonomy of "news categories" and "news tags" for it. They're showing up fine in the dashboard and I've assigned a test category and tag to one post to test. On the archive for "news", the posts show up, but the post meta does not.

    I found the genesis_post_meta function in the post.php file and what stood out to me was the line that said...

    * By default, only does post meta on posts.

    That seems to be my problem. It also says,

    * @return null Return early if post type lacks support.

    I've dug around the WordPress codex and have done searches to see how to add this support for my custom post type but I can't find anything. What do I need to do to have the entry meta show up? It's fine on blog posts, and I'm using the Genesis Sample as my base for this project.

    Here is all my code for adding the custom post type and taxonomy to my site:

    //* Add a custom post type
    add_action( 'init', 'mpp_post_type' );
    function mpp_post_type() {
      // Project custom post type
    	register_post_type( 'news',
    		array(
    			'labels' => array(
    				'name' => __( 'News' ),
    				'singular_name' => __( 'News Item' ),
    				'add_new_item' => __( 'Add New News Item' ),
                    'edit_item' => __( 'Edit News Item'),
                    'view_item' => __( 'View News Item'),
                    'taxonomies' => array( 'news-category','news-tag' ),
    			),
    			'has_archive' => true,
    			'public' => true,
    			'show_ui' => true, // defaults to true so don't have to include
    			'show_in_menu' => true, // defaults to true so don't have to include
    			'rewrite' => array( 'slug' => 'news' ),
    			'supports' => array( 'title', 'editor', 'author', 'excerpt', 'comments', 'genesis-seo', 'thumbnail','genesis-cpt-archives-settings' ),
    		)
    	);
    }
    
    // hook into the init action and call create_news_taxonomies when it fires
    add_action( 'init', 'create_news_taxonomies', 0 );
    
    // create two taxonomies, News Categories and New Tags for the post type "news"
    function create_news_taxonomies() {
    	// Add new taxonomy, make it hierarchical (like categories)
    	$labels = array(
    		'name'              => _x( 'News Categories', 'taxonomy general name', 'textdomain' ),
    		'singular_name'     => _x( 'News Category', 'taxonomy singular name', 'textdomain' ),
    		'search_items'      => __( 'Search News Categories', 'textdomain' ),
    		'all_items'         => __( 'All News Categories', 'textdomain' ),
    		'parent_item'       => __( 'Parent News Category', 'textdomain' ),
    		'parent_item_colon' => __( 'Parent News Category:', 'textdomain' ),
    		'edit_item'         => __( 'Edit News Category', 'textdomain' ),
    		'update_item'       => __( 'Update News Category', 'textdomain' ),
    		'add_new_item'      => __( 'Add New News Category', 'textdomain' ),
    		'new_item_name'     => __( 'New News Category Name', 'textdomain' ),
    		'menu_name'         => __( 'News Categories', 'textdomain' ),
    	);
    
    	$args = array(
    		'hierarchical'      => true,
    		'labels'            => $labels,
    		'show_ui'           => true,
    		'show_admin_column' => true,
    		'query_var'         => true,
    		'rewrite'           => array( 'slug' => 'news-category' ),
    	);
    
    	register_taxonomy( 'news-categories', array( 'news' ), $args );
    
    	// Add new taxonomy, NOT hierarchical (like tags)
    	$labels = array(
    		'name'                       => _x( 'News Tags', 'taxonomy general name', 'textdomain' ),
    		'singular_name'              => _x( 'News Tag', 'taxonomy singular name', 'textdomain' ),
    		'search_items'               => __( 'Search News Tags', 'textdomain' ),
    		'popular_items'              => __( 'Popular News Tags', 'textdomain' ),
    		'all_items'                  => __( 'All News Tags', 'textdomain' ),
    		'parent_item'                => null,
    		'parent_item_colon'          => null,
    		'edit_item'                  => __( 'Edit News Tags', 'textdomain' ),
    		'update_item'                => __( 'Update News Tag', 'textdomain' ),
    		'add_new_item'               => __( 'Add New News Tag', 'textdomain' ),
    		'new_item_name'              => __( 'New News Tag Name', 'textdomain' ),
    		'separate_items_with_commas' => __( 'Separate News Tags with commas', 'textdomain' ),
    		'add_or_remove_items'        => __( 'Add or remove News Tags', 'textdomain' ),
    		'choose_from_most_used'      => __( 'Choose from the most used News Tags', 'textdomain' ),
    		'not_found'                  => __( 'No News Tags found.', 'textdomain' ),
    		'menu_name'                  => __( 'News Tags', 'textdomain' ),
    	);
    
    	$args = array(
    		'hierarchical'          => false,
    		'labels'                => $labels,
    		'show_ui'               => true,
    		'show_admin_column'     => true,
    		'update_count_callback' => '_update_post_term_count',
    		'query_var'             => true,
    		'rewrite'               => array( 'slug' => 'news-tag' ),
    	);
    
    	register_taxonomy( 'news-tag', 'news', $args );
    }
    October 5, 2016 at 8:20 pm #194280
    David Borrink
    Participant

    I discovered that I had two errors in the code as my taxonomies array and rewrites had the wrong spelling. I had “news-category” in those two while my taxonomy is called “news-categories”.

    But that didn’t help. Still no entry meta display. But entry info is showing at the top of the posts. Why entry meta isn’t showing is odd. I’ve found posts where people are showing how to remove entry metas. I’d just like to know why mine isn’t showing.

    My HTML says <footer class="entry-footer"></footer>. In a regular blog post there is a <p class="entry-meta"> inside there.

  • 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

© 2025 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