Add Icons to the Product Category Sidebar Widget WooCommerce
Add Icons to the Product Category Sidebar Widget WooCommerce
Add Icons to the Product Category Sidebar Widget WooCommerce
Well the simplest way I can think of is something like this… <ul class=”categories”> <?php $categories = get_categories(); //can add parameters here to swtich the order, etc; if(!empty(categories)): foreach($categories as $i => $category): ?> <li class=”category”> <span><?php echo $category->name ?></span> <?php query_posts(‘posts_per_page=-1&cat=” . $category->term_id); if ( have_posts() ) : ?> <ul class=”posts”> <?php while ( … Read more
As per comment it is hard to answer this without knowing specifics of setup. In general there are two generic approaches to this: Prevent unwanted terms from being returned by filtering get_terms_args or other available hooks. Prevent unwanted terms from being saved (or cancel them right after) by hooking somewhere in wp_insert_post(). The more complex, … Read more
This would be the way I’d do it. Add the following to your functions.php; class Walker_Category_Posts extends Walker_Category { function start_el( &$output, $category, $depth, $args ) { parent::start_el( $output, $category, $depth, $args ); if ( $category->parent ) return $output; if ( $posts = get_posts( ‘posts_per_page=-1&no_found_rows=1&update_term_cache=0&cat=” . $category->term_id ) ) { $output .= “<ul>’; foreach ( … Read more
Since the category widget on the post page only lets you create categories and not delete them, you could just hide access to the main category editor page for this user type, and allow them to still create categories within the post editor. You could do this with CSS or javascript, something like $(‘ul.wp-submenu a[href=”https://wordpress.stackexchange.com/questions/14060/edit-tags.php?taxonomy=category”]’).hide(); … Read more
There is no simple way to do this via WP_Query(). Depending how many categories you have, the following may not be a good idea. If you have ~20 you may be ok. So, instead of saying “all posts excluding ones in 37”, you would do “get me everything in all terms (not specifying term_id 37”). … Read more
No quick way exists in the WordPress admin for 1500 posts, the better way would be to do it with MySQL directly either by custom queries and updated or by PhpMyAdmin and his friends.
I haven’t been working with WordPress too much, so there may be someone who can give you more details. But here’s what I’ve come to understand: If you want to have multiple blogs (one for each group) then you need to EITHER: Filter the posts according to who is logged in Operate a multi-site WordPress … Read more
Create 2 pages category-news.php & category-video.php & put this code in them. Then customize the markup for both as you like <?php $children = get_categories(‘child_of’=>get_query_var(‘cat’)); $cat = array(get_query_var(‘cat’)); foreach($children as $child) $cat[] = $child->term_id; $catPosts = new WP_Query( array( ‘category__in’ => $cat, ‘posts_per_page’ => 5, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ ) ); while ($catPosts->have_posts()) … Read more
Use custom post types for links. You can do anything with CPTs that you can do with the old blog roll … and much more. See also: How to do a custom bookmarks post type? Website bookmarks as a custom post type Aaron Parecki: Personal Bookmarks Mark Wilkinson: WordPress Press This With Custom Post Types