How to filter posts by specific date and its tag

Ashur Please try following code with date_query. this is working fine at my end. Let me know if you want any additional detail. <?php $postdate = get_the_date(‘Y-m-d’); $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘post’, ‘date_query’ => array( ‘after’ => $postdate, ) ); $update = new WP_Query($args); while ($update->have_posts()) { $update->the_post(); $post_id = get_the_ID(); … Read more

Don’t show a tag on a post if it is the only post with that tag

Because get_the_term_list() create the html link for you. So you need to use wp_get_object_terms to get a list of terms info first with count for handling. compare each tag count, if the count > 1 then create the link and output I have just tried. It works <p class=”meta-tag-list”> <?php $terms = wp_get_object_terms($post->ID, ‘category’); // … Read more

Tag with Alias capability

You can’t do it via the admin UI, but there is an alias_of argument for wp_insert_term which accepts a slug for the term you want it to be an alias of. In practice, I don’t know exactly how this works. See this thread from wp-hackers.

How to get all tags collections in woocommerce?

You need to loop through the array and create a separate array to check in_array because get_terms return object with in array. $terms = get_terms( ‘product_tag’ ); $term_array = array(); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { $term_array[] = $term->name; } } solution … Read more

Order tags by the order they were typed

To display post tags in order they were entered into WordPress, use this within the loop (returns a list of tag links): echo ‘<ul>’; $tag_list = wp_get_post_terms(get_the_ID(), ‘post_tag’, array(‘orderby’ => ‘term_id’, ‘fields’ => ‘all’)); foreach($tag_list as $tag) { echo ‘<li><a href=”‘ . get_term_link( $tag ) . ‘”>’ . esc_html( $tag->name ) . ‘</a></li>’; } echo … Read more