function redirect_uncategorized_category($request) { if(array_key_exists('category_name' , $request) && $request['category_name'] == "uncategorized") { wp_redirect(get_post_type_archive_link('post'), 301); exit; } else { return $request; } } add_filter('request', 'redirect_uncategorized_category'); Or I can create a category-uncategorized.php file and force a redirect in there like so: … [Read more...] about How to disable Uncategorized category URL?
Uncategorized
Posts says they are uncategorized but they are not
BUT category filters are working, and if you go to categories in backoffice you’ll see posts correctly counted, and if you go to the category in frontend you’ll see the posts. Even if you try to edit the post you’ll see that the category is correctly checked. … [Read more...] about Posts says they are uncategorized but they are not
How to find all posts without category and assign the “Uncategorized”?
Hi is there anybody who can help me how to find all posts without category and assign the "Uncategorized"? I have more than 7000 posts and 300 of them are without category, how I could assing one? … [Read more...] about How to find all posts without category and assign the “Uncategorized”?
Hide products in uncategorized category from search results
function wc_hide_selected_terms( $terms, $taxonomies, $args ) { $new_terms = array(); if ( in_array( 'product_cat', $taxonomies ) && !is_admin() && is_shop() ) { foreach ( $terms as $key => $term ) { if ( ! in_array( $term->slug, array( 'uncategorized' ) ) ) { $new_terms[] = $term; } } $terms = $new_terms; } return $terms; } add_filter( 'get_terms', 'wc_hide_selected_terms', 10, 3 ); These are attempts to hide the uncategorized (only) products from search results with no luck: … [Read more...] about Hide products in uncategorized category from search results
“Uncategorized” seems on breadcrumb
function get_breadcrumb() { echo '<a href="'.home_url().'" rel="nofollow">Home</a>'; if (is_category() || is_single()) { echo " » "; the_category(' • '); if (is_single()) { echo " » "; the_title(); } } elseif (is_page()) { echo " » "; echo the_title(); } elseif (is_search()) { echo " » Search Results for... "; echo '"<em>'; echo the_search_query(); echo '</em>"'; } } ?> <div class="breadcrumb"><?php get_breadcrumb(); ?></div> </div> … [Read more...] about “Uncategorized” seems on breadcrumb