• I’m modifying a theme that has several post_types, like “Services,” “Our Team” and “Portfolio.” However, the portfolio and our team post types do not have “Add New” options.

    I’ve done searches through the theme trying to find a register_post_type to add that line, but apparently those where added in some other way. I’ve also dug through the tables, but couldn’t find anything obvious.

    Anyone know where this post types would be configured?

    Martin

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you tried looking in your functions.php?

    Thread Starter Martin Malley

    (@martin-malley)

    First thing was to dig in the functions.php. I did a search of all the files in the theme folder and cannot find the word portfolio in any function type file. Also looked in the tables and found some things, but it was not obvious how they worked.

    Is the Portfolio post_type standard in wordpress? I working on the assumption that the theme developer would have had to add it.

    Look inside functions.php see if there is a require to any file in other places like in inc or include folder.

    Also, check plugin, some people use plugin to register CPT.

    and lastly, are you sure that this is a CPT ? it might be a custom taxonomy to go along with CPT ( that’s usually happens when there is a need for CPT, people also register taxonomy for it.)

    Thread Starter Martin Malley

    (@martin-malley)

    So I found the register code in theme-init.php. But there is no mention of setting up the add new in any of the CPT listed there.

    function my_post_type_portfolio() {
    	register_post_type( 'portfolio',
                  array(
    		'label' => __('Portfolio'),
    		'singular_label' => __('Porfolio Item', 'theme1471'),
    		'_builtin' => false,
    		'public' => true,
    		'show_ui' => true,
    		'show_in_nav_menus' => true,
    		'hierarchical' => true,
    		'capability_type' => 'page',
    		'menu_icon' => get_template_directory_uri() . '/includes/images/icon_portfolio.png',
    		'rewrite' => array(
    		'slug' => 'portfolio-view',
    		'with_front' => FALSE,
    				),
    		'supports' => array(
    				'title',
    				'editor',
    				'thumbnail',
    				'excerpt',
    				'custom-fields',
    				'comments')
    			)
    				);
    	register_taxonomy('portfolio_category', 'portfolio', array('hierarchical' => true, 'label' => 'Portfolio Categories', 'singular_name' => 'Category', "rewrite" => true, "query_var" => true));
    }
    
    add_action('init', 'my_post_type_portfolio');

    I tried adding:

    'add_new' => __( 'Add New', 'portfolio'),
                        'add_new_item' => __( 'Add New' ),
                        'new_item' => __( 'New'),

    But no joy. What am I missing?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘"Add New" for a post type’ is closed to new replies.