Show icons or badges under title on product archives/category pages

So I was not able to solve my problem earlier, then I switched the plugin to “Category and Taxonomy Image” (by Aftab Hussain) and used the following code to display the icons on category/archive pages: add_action( ‘woocommerce_after_shop_loop_item’, ‘attribute_img_loop’, 20 ); function attribute_img_loop() { global $product; // Check that we got the instance of the WC_Product … Read more

Only display archive subtitle on the first archive page

is_paged() can be used to tell if you are on any page other than the first page of an archive. You could use it like this: <?php if ( $archive_subtitle && ! is_paged() ) { ?> <div class=”archive-subtitle section-inner thin max-percentage intro-text”><?php echo wp_kses_post( wpautop( $archive_subtitle ) ); ?></div> <?php } ?>

How can I loop only months foreach year?

I have tried your query. It plays in right way. I think the problem is your handling of current year in the foreach loop. I suppose you would like to achieve this effect, right? // it is the test result based on some dummy posts 2020 March 2000 October 1999 March January 1986 September 1981 … Read more

Conditional post thumbnail based on logged status and post tag

Hey you have to use the below logic to handle the above conditions, it will work. if (!is_user_logged_in() && has_tag(‘private’)) { ?> <a href=”https://wordpress.stackexchange.com/questions/368246/<?php the_permalink(); ?>” title=”<?php the_title_attribute(); ?>”> <img src=”<?php bloginfo(‘template_directory’); ?>/img/default-login.jpg” alt=”<?php the_title(); ?>” /> </a> <?php } else if( is_user_logged_in() && has_tag(‘private’) ) { // show the actual featured image // check … Read more

Only show posts with a specific term of an associated taxonomy in a custom post type archive

Try adding to functions.php function filter_movies( $query ) { if( !is_admin() && $query->is_main_query() && $query->get(‘post_type’) == ‘movie’) { $tax_query = array( array( ‘taxonomy’ => ‘period’, ‘field’ => ‘slug’, ‘terms’ => ‘current’, ), ); $query->set( ‘tax_query’, $tax_query ); } } add_action(‘pre_get_posts’, ‘filter_movies’, 9999);

How do I add custom HTML to the content of an archive page’s posts?

Try changing the priority, there could be other filters being applied afterwards, i.e: add_filter( ‘the_content’, ‘eri_course_archive_content_filter’, 999 ); If that doesn’t work, check that the_content() is actually being called in your archive template, because for example: echo get_the_content(); will not apply any filters set on the_content

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