Hi! I am new to theme development, and I want to do all without plugins. (unless I create them that is). I have learned about custom post types and taxonomy, but I cannot get it to work like it does in the video. There are actually a couple of problems, but first one first and we’ll see if that fixes the rest.
There is a custom post type called Recipes. Then the category is supposed to be Country. User makes a recipe post (which will eventually have its own html template) and gets to select which country categor y it will go to. I see in the video that the category goes below custom post type in admin bar, but for me, it does not. Can anyone tell me what I am doing wrong? Thanks!
lect which country categor y it will go to. I see in the video that the category goes below custom post type in admin bar, but for me, it does not. Can anyone tell me what I am doing wrong? Thanks!
<code> // Register Taxonomy Country function create_country_tax() { $labels = array( ‘name’ => _x( ‘Countries’, ‘taxonomy general name’, ‘textdomain’ ), ‘singular_name’ => _x( ‘Country’, ‘taxonomy singular name’, ‘textdomain’ ), ‘parent_item’ => __( ‘Recipes’ ), ); $args = array( ‘labels’ => $labels, ‘description’ => __( ”, ‘textdomain’ ), ‘hierarchical’ => true, ‘public’ => true, ‘publicly_queryable’ => true, ‘show_ui’ => true, ‘show_in_menu’ => true, ‘show_in_nav_menus’ => true, ‘show_tagcloud’ => false, ‘show_in_quick_edit’ => true, ‘show_admin_column’ => true, ‘show_in_rest’ => true, ‘taxonomies’ => array(‘Countries’), ); register_taxonomy( ‘country’, array(‘Recipes’), $args ); } add_action( ‘init’, ‘create_country_tax’ );
