How to add custom post type under option page

You can add custom post type in Settings menu by passing ‘options-general.php’ value to ‘show_in_menu’ parameter as shown below Example : ‘show_in_menu’ => ‘options-general.php’ Full Code : function codex_custom_init() { $labels = array( ‘name’ => ‘Books’, ‘singular_name’ => ‘Book’, ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add New Book’, ‘edit_item’ => ‘Edit Book’, ‘new_item’ => ‘New … Read more

Custom Taxonomy – Tags Metabox is showing instead of Categories

You need to set hierarchical argument of your taxonomy to true (by default it’s false): function product_category_taxonomy() { $labels = array( ‘name’ => __( ‘Product Categories’ ), ‘singular_name’ => __( ‘Product Category’ ), ‘search_items’ => __( ‘Search Product Categories’ ), ‘all_items’ => __( ‘All Product Categories’ ), ‘parent_item’ => __( ‘Parent Product Category’ ), ‘parent_item_colon’ … Read more

Get Author for Single Post in Custom Post Type

There are several functions for this available, like: the_author, for displaying; get_the_author, for returning. There is no restriction regarding custom post types, but those template tags only work inside the loop. If you want to get more author information then the name you can use: the_author_meta, displaying; get_the_author_meta, returning. The latter two functions can also … Read more