Show subcategories broken when WP/WC updates

Found the answer myself, since WC 3.3 woocommerce_product_subcategories is deprecated and returns an empty value: Link to woocommerce docs So you have to implement your own subcategories list view. I used as hint the code found here and rebuild the categories page as it was before

Blog page with posts from specific categories

Please add following code $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘category__and’ => array( 2, 6 ), ‘posts_per_page’ => 1, ); $arr_posts = new WP_Query( $args ); OR $tax_query = array( relation => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘term_id’, // ‘term_id’ by default, so just here as an example ‘terms’ => … Read more

How to set acf color field as background color to product category

The style-attribute is not in the span-tag, but should be. Further you are using the php opening tag inside of the echo tag (copy-paste?). change ‘<span class=”termek-oldal-kategoria-teszt”> style=”background-color:<?php the_field(‘kollekcio_szine’); ?>”‘ to ‘<span class=”termek-oldal-kategoria-teszt” style=”background-color:’.get_field(‘kollekcio_szine’) . ‘”>’ (sorry, I would have commented, but I don’t have enough reputation)

Add Catgory (assign) to Post Programmatically (without editing)

You can set post terms programmatically with wp_set_object_terms(). There’s also wp_set_post_terms() which is a wrapper for the first function, but with some extra processing of the parameters in it. foreach ( $array_of_post_ids as $post_id ) { // appends my-category to a post’s categories wp_set_object_terms( $post_id, ‘my-category’, ‘category’, true ); }

How to exclude a category returned by get_categories from function.php?

You’ll find an appropriate filter in the get_terms function which is called by get_categories. See source code https://github.com/WordPress/WordPress/blob/master/wp-includes/taxonomy.php#L1247 We don’t use any of the callback arguments in this case. We can use array_filter on the list of terms (WP_Term) objects. See https://developer.wordpress.org/reference/classes/wp_term/ This allows us to remove a term with a particular ID add_filter( ‘get_terms’, … Read more