the_tags outputs before echo

the_tags() doesn’t return the links but immediately echoes them. As that happens before the echo they appear before the span. What you want is this: echo ‘<span class=”tags”>’; the_tags(‘See also: ‘, ‘ &middot; ‘); echo ‘</span>’; or even simpler the_tags( ‘<span class=”tags”> See also: ‘,’ &middot; ‘, ‘</span>’ ); As a general rule of thumb … Read more

If tag x then show y + tag name(s)

you can use the get_the_tags function, something along the lines of: $posttags = get_the_tags(); if ($posttags) { echo (count($posttags) > 1) ? ‘Tags: ‘ : ‘Tag: ‘; $links = array(); foreach($posttags as $tag) { $links[] = sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/255261/%s”>%s</a>’, get_tag_link($tag->term_id), $tag->name); } echo implode(‘, ‘, $links); } Reference: https://codex.wordpress.org/Function_Reference/get_the_tags

Remove parentheses from tag cloud count

this is an example output of an tag cloud widget element (wp4.8): <a href=”http://localhost/wp-beta-test/tag/handcrafted/” class=”tag-cloud-link tag-link-327 tag-link-position-22″ style=”font-size: 8pt;” aria-label=”handcrafted (2 items)”>handcrafted<span class=”tag-link-count”> (2)</span></a> as you can see, the widget outputs some aria lable also using parentheses, which interferes with a simple string replace. the tag number including the parentheses is also already wrapped in … Read more

How to list tags

Thanks for your answer. I figured it out, i was using the wrong function. <?php $tags = get_the_tag_list($before=”<li>”, $sep = ‘</li><li>’ $after=”</li>”); if( count( $tags) > 0) { echo ‘<div id=”etiquetas”>’; echo ‘<ul class”tags”>’; echo $tags; echo ‘</ul>’; echo ‘</div>’; } ?>

How to Group While Loop “Results” of wp_query?

I will probably do something like this to make it dynamic but this have some issue with the title that must be “Season $n” in the title. Probably better solution will be to add some custom field with the season or some custom taxonomy just to filter. if ( $my_query->have_posts() ){ $seasons = array(); foreach($my_query->posts … Read more

Is it possible to have a Faceted Navigation/Filters on a Product Tag page?

I suggest evaluating the premium plugin FacetWP (I am not affiliated with them), that supports faceted navigation and filters for WooCommerce too. https://facetwp.com/using-facetwp-with-woocommerce/ Or any other similar plugin of course, I know only FacetWP myself. As for the second question, I think that such plugins manage the display of specific filters automatically, excluding non-pertinent ones.

How to show tags + posts for a custom taxonomy?

To list names and descriptions you can use get_terms(). That will return an array with all terms. An example would be: global $post; $terms = get_terms( array( ‘taxonomy’ => ‘item_tags’, ‘hide_empty’ => false, ) ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { echo … Read more

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