How to checked selected category checkbox when my custom post inserted from frontend

// set Selected Post CATEGORY cheked wp_set_object_terms( $post_id, array((int)$_POST[‘movies_cat’]), ‘movies’ ); } else{ die(“check seccurity”);} // This bellow given code add on design page <p class=”meta-options hcf_field”> <label for=”movies”>The Categories</label> <?php wp_dropdown_categories( ‘taxonomy=movies&name=movies_cat&show_option_all=Select a category’ ); ?> </p>

Can’t remove front from permalinks for custom taxonomy category page

To get the URL like example.tld/portfolio/PORTFOLIO-CATEGORY-NAME/PORTFOLIO-NAME/ do the following. Change rewrite for the custom post type to ‘rewrite’ => array( ‘slug’ => ‘portfolio/%portfolio-categorie%’, ‘with_front’ => false ), Change rewrite for the custom taxonomy to ‘rewrite’ => array( ‘with_front’ => false ), Use post_type_link filter to replace %portfolio-categorie% with the actual taxonomy term: add_filter( ‘post_type_link’, ‘my_portfolio_permalink’, … Read more

Taxonomies don’t show up on in the dashboard page for a custom post type in wordpress 5.22

I’ve pasted your code in Twenty Nineteen and it works as expected with Classic Editor ( and I’m sure it will work pre-Block Editor also ). Your taxonomy will not show up in the Block Editor unless you specify to display that taxonomy in rest as you’ve done with your post type: register_taxonomy( ‘product-category’, ‘product’, … Read more

How to target parent product category and its children using WooCommerce?

the WordPress function cat_is_ancestor_of() is made for WordPress categories, but not for WooCommerce product categories which is a custom taxonomy product_cat. For Custom taxonomies you can use WordPress term_is_ancestor_of() function like: term_is_ancestor_of( 19, get_queried_object_id(), ‘product_cat’ ) So in your code: if ( is_product_category( ‘foo-category’ ) || term_is_ancestor_of( 19, get_queried_object_id(), ‘product_cat’ ) ) { wc_get_template( ‘archive-foo.php’ … Read more