outputting taxonomy hierarchy

OK, so if the empty terms shouldn’t be displayed in there, then it’ll be pretty easy 😉 All you have to do is to use wp_list_categories function: <ul> <?php wp_list_categories( array( ‘taxonomy’ => ‘sfcategory’, ‘title_li’ => false, ‘hide_empty’ => true // or false, as you wish ) ); ?> </ul>

Editing categories crashes WordPress site

Never touch the slug! I started doing WordPress 6 months ago and just used default settings and categorized most posts into one category. What seems to have caused the system crash and CPU “off the charts” was that I changed the name of the part of the WP-URL that comes between server name and post … Read more

How to add custom option to wp_dropdown_categories?

You can do like this add_filter( ‘wp_dropdown_cats’, ‘add_yet_another_option’, 10, 2 ); function add_yet_another_option( $output, $r ){ $output = str_replace( ‘</select>’,”,$output ); // remove closing select tag $output .= ‘<option class=”level-0″ value=”some-value”> Some Custom Options </option>’; // custom option. $output .= ‘</select>’; // add closing select tag return $output; } But why would someone put custom … Read more

How can I make a category function as a page?

With Beaver Builder, I’d just add another plugin called “Display Posts Shortcode” that will insert your category wherever you’d like. Maybe the following will help: Download the plugin “Display Posts Shortcode” here: https://wordpress.org/plugins/display-posts-shortcode/ Insert the following text on the page where you want display the posts in your category: [display-posts category=”categoryname“] You can choose to … Read more

Some subcategories not working on custom portfolio sort

You can use below code: $args = array( ‘type’ => ‘product’, ‘child_of’ => 0, ‘parent’ => ”, ‘orderby’ => ‘term_group’, ‘hide_empty’ => false, ‘hierarchical’ => 1, ‘exclude’ => ”, ‘include’ => ”, ‘number’ => ”, ‘taxonomy’ => ‘product_cat’, ‘pad_counts’ => false ); $cats = get_categories( $args );

Limit post top level categories to one

Late answer but I figured I’d throw in my idea since I had a similar problem recently. Basically I did this by injecting a script into the editor views. My function looked something like this: (function() { var o=function() { //add a click handler to category checkboxes jQuery(“#categorychecklist input”).click(function() { //get top-level category (in case … Read more