Create/Set Category as Title of Post

Can’t give you fish, but I can try you to teach how to fish with a couple of pointers; hook into publish_post (good example code there) and / or post_updated in the function that is called that way, use wp_create_category (which will only create if the cat. name doesn’t exist yet) and with the cat … Read more

Limit title length

It’s because you’re not using the filter correctly. The the_title filter passes the title to be filtered as the $title argument, but you’re overwriting it with this code: global $post; $id = ($post->ID); $title = get_post( $id )->post_title; That code’s completely unnecessary because the title is already available in your function: function max_title_length( $title ) … Read more

Parent category as WOOCommerce Categories widget title

Try this it works for me. Place this code in your theme functions.php file. function dynamic_product_category_widget($title, $widet_instance, $widget_id) { if ( $widget_id !== ‘woocommerce_product_categories’ ) return $title; if ( is_product_category() ) { $cat_title = single_cat_title(‘<p class=”widget-title footer-widget”>’, ‘</p>’); return $cat_title; } elseif ( is_product() ) { $cat = get_the_terms( $product->ID, ‘product_cat’ ); foreach ($cat as … Read more