Custom Post Type with Custom Taxonomy Not Working
-
I have a page using the shortcode that was working fine until I added the custom taxonomy I created. Nothing is displaying.
Here is the shortcode:
[ajax_load_more container_type="div" taxonomy="categories" taxonomy_terms="i-sober-story" taxonomy_operator="IN" category_post_type="i_sober_story" posts_per_page="8" button_label="VIEW MORE" transition_container_classes="grid-x grid-padding-x small-up-1 medium-up-3 large-up-4" scroll="false"]
Here is the custom post type code and taxonomy code:
function ru_custom_post_i_sober_story() { $labels = array( 'name' => _x('I Sober Story', 'post type general name'), 'singular_name' => _x('I Sober Story', 'post type singular name'), 'add_new' => _x('Add New', 'I Sober Story'), 'add_new_item' => __('Add New I Sober Story'), 'edit_item' => __('Edit I Sober Story'), 'new_item' => __('New I Sober Story'), 'view_item' => __('View I Sober Story'), 'search_items' => __('Search I Sober Story'), 'not_found' => __('Nothing found'), 'not_found_in_trash' => __('Nothing found in Trash'), 'parent_item_colon' => '', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 5, 'supports' => array('title','thumbnail', 'author'), ); register_post_type( 'i_sober_story' , $args ); } add_action( 'init', 'build_taxonomies_i_sober', 0 ); function build_taxonomies_i_sober() { $labels = array( 'name' => _x( 'Categories', 'taxonomy general name' ), 'singular_name' => _x( 'Category', 'taxonomy singular name' ), 'search_items' => __( 'Search Categories' ), 'all_items' => __( 'All Categories' ), 'parent_item' => __( 'Parent Category' ), 'parent_item_colon' => __( 'Parent Category:' ), 'edit_item' => __( 'Edit Category' ), 'update_item' => __( 'Update Category' ), 'add_new_item' => __( 'Add New Category' ), 'new_item_name' => __( 'New Category Name' ), 'menu_name' => __( 'Categories' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'category' ), ); register_taxonomy( 'categories', array( 'i_sober_story' ), $args ); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom Post Type with Custom Taxonomy Not Working’ is closed to new replies.