How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
This is a lot simpler than you might believe, first, I must dispel some misconceptions: post_type is not a parameter of get_categories, isn’t listed in the documentation, and wouldn’t make sense. Categories are terms not posts, they don’t have a post type, and this API call retrieves terms, it has no business looking into the … Read more
Removing custom post type slug from URL
I solved my own question without breaking the url structure logic, as Krzysiek Dróżdż (thanks!) suggested. I changed the page named /page-actueel-blog to the custom-post-type ‘archive’ template. Pretty obvious, but I thought archive was something else entirely. For whoever may have the same doubts: the archive template is the level up from domain.com/blogpost (single-mycustomposttypename.php); a … Read more
Custom post type showing index.php
This only takes care of two levels. You could make a recursive function, if you have ‘unlimited’ levels. $custom_terms = get_terms(‘custom_taxonomy’); /** * Loop through all taxonomies */ foreach($custom_terms as $custom_term): // Reset query (for good measures sake) wp_reset_query(); // Set the args (getting ready to get posts that are in the given taxonomy) $outer_args … Read more
What I need to see was the posts were draft, I had to add the capabilty delete_posts.
Please add exclude_from_search to false, inside your register post type function add_action(‘init’, ‘eyewebz_create_post_types’); function eyewebz_create_post_types() { register_post_type(‘project’, array( ‘taxonomies’ => array(‘category’), ‘labels’ => $labels, ‘has_archive’ => true, ‘show_in_rest’ => true, ‘hierarchical’ => true, ‘public’ => true, ‘publicly_queryable’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘post-formats’, ‘page-attributes’, ‘thumbnail’, ‘excerpt’), ‘exclude_from_search’ => false, ‘menu_icon’ => ‘dashicons-index-card’ )); }
I’ve figured out a fix. First, to fix bad results for an empty search, I require that (!empty(get_query_var(‘s’)) Before setting the “meta_query” query variable in my plugin. I thought the fix would be with the posts_request filter, but it continued to replace select SQL_CALC_GET_ROWS wp_posts.ID with select SQL_CALC_GET_ROWS wp_posts.* Even when I replaced the * … Read more
WordPress custom taxonomy, posts urls