• 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

Diplaying Custom Post type

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 › Design Tips and Tricks › Diplaying Custom Post type

This topic is: not resolved

Tagged: custom post types

  • This topic has 6 replies, 2 voices, and was last updated 11 years ago by codebot5000.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • July 18, 2015 at 2:13 pm #159758
    codebot5000
    Member

    Hi, I created a custom post type and published a post here http://www.jeff-cunningham.com/jc_portfolio/first-custom-post/ Now I would like this post to display on a page I created called portfolio. I tried matching the permalink of the portfolio page to the permalink of the custom post above, however it still does not display on the portfolio page.

    I have tried looking this up online but no one is clear on how to do this. I followed several articles that told me to match the permalinks and make sure the permalink setting was set to post name which I did.

    Any knowledge you could impart would be greatly appreciated.

    http://www.jeff-cunningham.com
    July 18, 2015 at 2:19 pm #159761
    Christoph
    Member

    Hi,

    I see the post at http://www.jeff-cunningham.com/jc_portfolio/first-custom-post/
    The archive at jeff-cunningham.com/jc_portfolio/ might not be set up right.
    Did you set the page template to the archive for your custom post type?


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    July 18, 2015 at 2:39 pm #159762
    codebot5000
    Member

    I did not set up a page template because as soon as I set my has_archive to true my whole page breaks. You will see now that there is an internal sever error as a result of adding this 'has_archive' => true,

    Here is the custom post type I'm working with

    <?php
    /*
    Plugin Name: Custom Post Types
    Plugin URI: http://www.jeff-cunningham.com/
    Description: Here are the custom post types for my website
    Version: 1.0
    Author: Jeff Cunningham
    Author URI: http://jeff-cunningham.com
    */
    
    class JC_Portfolio_Post_Type{
    	public function __construct(){
    		$this->register_post_type();
    		$this->taxonomies();
    	}
    
    	public function register_post_type(){
    		$labels = array (
    			'name'				=> 'portfolio Selection',
    			'singular_name'		=> 'portfolio',
    			'add_new'            => 'Add New portfolio',
    			'add_new_item'       => 'Add New portfolio',
    			'edit_item'          => 'Edit portfolio',
    			'new_item'           => 'New portfolio',
    			'all_items'          => 'All portfolio',
    			'view_item'          => 'View portfolio',
    			'search_items'       => 'Search All portfolio',
    			'not_found'        	 => 'Nothing found',
    			'not_found_in_trash' => 'Nothing found in the Trash', 
    			'parent_item_colon'  => '',
    			'menu_name'          => 'portfolio Selection'
    			'has_archive'        => true,
    
    			);
    		$args = array (
    			'labels' 		=> $labels,
    			'description' 	=> 'This section holds all portfolio pieces',
    			'public'		=> true,
    			'menu_position'	=> 6,
    			// 'menu_icon'		=> get_stylesheet_directory_uri() .'images/movie_art.png'
    			'supports'		=> array('title', 'editor')
    			);
    		register_post_type ('jc_portfolio', $args);
    	}
    	public function taxonomies(){
    		$taxonomies = array();
    
    		$taxonomies['genre'] = array (
    			'query_var'		=> 'movie_var',
    			'hierachical'	=> true,
    			'rewrite'		=> array ( 'slug' => 'movies/genre'),
    			'labels'		=> array (
    				'name' 				=> 'Genre',
    				'singular_name' 	=> 'Genre',
    				'search_items'		=> 'Search Genre', 	
    				'all_items' 		=> 'All Genre',
    				'parent_item' 		=> 'Parent Genre',
    				'parent_item_colon' => 'Parent Genre',
    				'edit_item' 		=> 'Edit Genre',
    				'update_item' 		=> 'Update Genre',
    				'add_new_item' 		=> 'Add New Genre',
    				'new_item_name' 	=> 'New Genre Name',
    				'menu_name' 		=> 'Genre'
    				)
    			);
    		$taxonomies['studio'] = array (
    			'query_var'		=> 'movie_var',
    			'hierachical'	=> true,
    			'rewrite'		=> array ( 'slug' => 'movies/studio'),
    			'labels'		=> array (
    				'name' 				=> 'Studio',
    				'singular_name' 	=> 'Studio',
    				'search_items'		=> 'Search Studio', 	
    				'all_items' 		=> 'All Studio',
    				'parent_item' 		=> 'Parent Studio',
    				'parent_item_colon' => 'Parent Studio',
    				'edit_item' 		=> 'Edit Studio',
    				'update_item' 		=> 'Update Studio',
    				'add_new_item' 		=> 'Add New Studio',
    				'new_item_name' 	=> 'New Studio Name',
    				'menu_name' 		=> 'Studio'
    				)
    			);
    		$this->register_all_taxonomies($taxonomies);
    	}
    
    	public function register_all_taxonomies($taxonomies){
    		foreach ($taxonomies as $name => $arr) {
    			register_taxonomy ($name, array(dh_movies), $arr);
    		}
    		
    	}
    	
    }
    
    add_action('init', function(){
    	new JC_Portfolio_Post_Type();
    });
    July 18, 2015 at 5:15 pm #159782
    Christoph
    Member

    Hi,

    you are missing a comma after 'portfolio Selection':

    'menu_name'          => 'portfolio Selection'
    'has_archive'        => true,

    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    July 23, 2015 at 4:26 pm #160247
    codebot5000
    Member

    Thanks, the page is now working, but I still can't seem to get my custom post type page to display in the nav menu. I have tried the method copied below. The problem is that after I refresh the permalinks I'm not seeing anything display in the menu section that I can drag over.

    Displaying Your Post Type on the Front End

    Once you’ve added some products, you’ll need to be able to display these on the front end of your site.
    Setting Permalinks to Link to Your Post Type’s Pages

    First you need to refresh the permalinks on your site so that WordPress will use the correct links to display products or product archives:

    In the WordPress admin, go to Settings -> Permalinks.
    Make sure the ‘post name’ option is selected.
    Click the Save Changes button.

    Note: You need to do this even if you’ve already configured permalinks, as WordPress needs to refresh these settings for the new set of links to your products.
    Adding Your Post Type to the Navigation Menu

    If you want to add products to your navigation menu, you can. Go to Appearance -> Menus, and you’ll see that Products are displayed on the left. Simply drag any products onto your menu to include them.

    July 24, 2015 at 11:36 am #160320
    Christoph
    Member

    Hi,

    sorry, I cannot replicate your problem.
    I'm using your code, "refreshed" the permalinks and created 3 test portfolios.
    This is what shows under Appearance - Menus
    http://screencast.com/t/G65k7is69XR2


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    July 24, 2015 at 5:34 pm #160372
    codebot5000
    Member

    I don't know what the issue is. It works fine on my localhost page but wont work on my parallax pro child theme. It's driving me crazy.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Design Tips and Tricks’ 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

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