Show post only if match all categories

Here’s an updated version of your code that will get posts that have the Post Format Video and that have the same Categories as the current post in the loop. You’ll call wpse_get_video_posts_with_matching_categories() to execute the function. function wpse_get_video_posts_with_matching_categories() { $categories = get_the_category( get_the_ID() ); if ( empty ( $categories ) ) { return; } … Read more

Automatically add product_categories to nav_menu

put this on your functions.php and then call the function in whatever page desired. this code is prepare to use css. if (! function_exists(‘menu_categories’)) { function menu_categories(){ $cat_args = array( ‘orderby’ => ‘name’, ‘order’ => ‘asc’, ‘hide_empty’ => true); $cats = get_terms( ‘product_cat’, $cat_args ); ?> <h1>Categories</h1><?php foreach ($cats as $key => $cat): if ($cat->parent … Read more

Redirect category to first available child post

I had to do that, but only in some categories in my site. This was the code I used – I put it in my theme’s functions.php: // use template_redirect action: add_action( ‘template_redirect’, ‘my_redirect_to_post’ ); /// Function to redirect from certain category pages to first post of those categories function my_redirect_to_post() { if (is_category(‘3’) || … Read more

Multi-site or categories?

Categories are meta data for n:n relations: Each category can be related to multiple posts, and each post to multiple categories. So categories aren’t what you need. I would set up a multi site installation. Use the main site for everything related to all sub sites and the subdomains or sub blogs for each section. … Read more

How can we get Catergory / Term Creator

By “creator” you mean the user who created the category? If so, that information is not stored by WordPress. You would have to write your own function for storing the user on category insert, maybe by hooking into the create_term function.