Customize WordPress widget – Product Category

Taking a look at the output rendered by the widget shows that the markup is missing a closing <a> tag for the term links and the widget instance does not have the closing </li>. Viewing the page source and formatting the output makes it easier to identify these issues: <li id=”mdk_wpcat_widget-2″ class=”widget-container mdk_wpcat_widget”> <h3 class=”widget-title”>Wooooo!</h3> … Read more

Add category only if post has custom taxonomy category

wp_get_post_terms( $post_id, $taxonomy, $args ) expects third param to be an array of arguments. Params $post_id (integer) (optional) The Post ID Default: 0 $taxonomy (string|array) (optional) The taxonomy for which to retrieve terms. Defaults to post_tag. Default: ‘post_tag’ $args (array) (optional) Overwrite the defaults Default: array My guess is that $old_term is being set to … Read more

Custom sub taxonomy order by

It’s a little bit hard to say what exactly was the point of your code… First problem that I can see is that you’re misusing get_term_by function. This function takes 5 params: get_term_by( $field, $value, $taxonomy, $output, $filter ) $field (string) (required) Either ‘id’, ‘slug’, ‘name’, or ‘term_taxonomy_id’ $value (string|integer) (required) Search for this term … Read more