Outputting an array of term meta values in a custom WooCommerce tab?

For your author content display, instead of print_r($all_term_meta); try a foreach: foreach($all_term_meta as $meta) { return $meta[0]; } It’s possible you may need to use “echo” instead of “return” but try “return” first. To control whether or not there is an author tab, update your woo_new_product_tab function with the same condition: function woo_new_product_tab( $tabs ) … Read more

Search by type posts and taxonomy

You can add a custom tax_query to your filter, and pass the search query to it: function searchfilter($query) { if ($query->is_search && !is_admin() ) { $s = $query->get( ‘s’ ); $query->set(‘post_type’, [ ‘lesson’, ‘series’ ] ); $query->set( ‘tax_query’, [ [ ‘taxonomy’ => ‘your-taxonomy’, ‘field’ => ‘name’, ‘terms’ => $s , ] ] ); } return … Read more

Get Bottom Most Level Taxonomy Terms?

Here is the solution I ended up with. This may help others too. $taxonomy = “product-category”; $args = array( ‘taxonomy’ => $taxonomy, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hierarchical’ => true, ‘hide_empty’ => false, ); $the_query = new WP_Term_Query($args); $categories = $the_query->get_terms(); if ($categories){ foreach($categories as $category){ $ancestors = get_ancestors( $category->term_id, $taxonomy ); $category->ancestors = … Read more

Taxonomy page template changing when using query variables

The problem is that category_name is a reserved keyword for the built-in categories for posts. Almost anything category_* is reserved. You can find a list of reserved keywords at the following url: https://codex.wordpress.org/Reserved_Terms This includes, but is not limited to: cat category category__and category__in category__not_in category_name term terms Behind the scenes it sees that you’re … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)