'Category', 'singular_name' => 'Category', 'menu_name' => 'Categories', 'all_items' => 'All Categories', 'parent_item' => 'Parent Category', 'parent_item_colon' => 'Parent Category:', 'new_item_name' => 'New Category Name', 'add_new_item' => 'Add New Category', 'edit_item' => 'Edit Category', 'update_item' => 'Update Category', 'separate_items_with_commas' => 'Separate categories with commas', 'search_items' => 'Search categories', 'add_or_remove_items' => 'Add or remove categories', 'choose_from_most_used' => 'Choose from the most used categories', ); $taxonomy_rewrite = array( 'slug' => 'amazing-portfolio-category', 'with_front' => true, 'hierarchical' => true, ); $taxonomy_args = array( 'labels' => $taxonomy_labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'show_tagcloud' => true, 'rewrite' => $taxonomy_rewrite, ); register_taxonomy( 'amazing-portfolio-category', array( 'amazing-portfolio' ), $taxonomy_args ); //Register new post type $post_type_labels = array( 'name' => 'Amazing Portfolio', 'singular_name' => 'Portfolio', 'menu_name' => 'Amazing Portfolio', 'parent_item_colon' => 'Parent Portfolio:', 'all_items' => 'All Portfolios', 'view_item' => 'View Portfolio', 'add_new_item' => 'Add New Portfolio', 'add_new' => 'Add New', 'edit_item' => 'Edit Portfolio', 'update_item' => 'Update Portfolio', 'search_items' => 'Search portfolios', 'not_found' => 'No portfolios found', 'not_found_in_trash' => 'No portfolios found in Trash', ); $post_type_rewrite = array( 'slug' => 'amazing-portfolio-item', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $post_type_args = array( 'label' => 'portfolio', 'description' => 'Portfolio information pages', 'labels' => $post_type_labels, 'supports' => array( 'title', 'editor', 'comments', 'revisions'), 'taxonomies' => array( 'post' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_icon' => 'dashicons-format-gallery', 'has_archive' => true, 'publicly_queryable' => true, 'rewrite' => array( 'slug' => 'amazing-portfolio' ), 'capability_type' => 'post', ); register_post_type( 'amazing-portfolio', $post_type_args ); } add_action('init', 'amazing_portfolio_custom_post_register'); function apl_flush_rules_on_save_posts( $post_id ) { flush_rewrite_rules(); } add_action( 'save_post', 'apl_flush_rules_on_save_posts', 20, 2); //Load Framework require_once ( APL_DIR . '/inc/framework/cs-framework.php'); //Shortcode require_once ( APL_DIR . '/shortcodes/index.php'); // Pagination require_once ( APL_DIR . '/inc/apl-pagination.php'); add_filter( 'template_include', 'apl_include_template_function', 1 ); function apl_include_template_function( $template_path ) { global $post; if ( get_post_type() == 'amazing-portfolio' ) { if ( is_single() ) { $template_path = dirname( __FILE__ ) . '/inc/single-portfolio.php'; } } return $template_path; } //widget shortcode support add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode');