How can I get a comment ID on Submit?

You can hook comment_post and add your logic with the comment id // Save the data along with comment id add_action( ‘comment_post’, ‘wti_save_comment_data’ ); function wti_save_comment_data( $comment_id ) { // Use the comment id and add your logic }

find posts with exactly 3/4 categories

Make sure you are providing correct category names into the function get_cat_ID(). <?php $catIDs = array(); $catIDs[] = get_cat_ID( ‘CategoryName1’ ); $catIDs[] = get_cat_ID( ‘CategoryName2’ ); $catIDs[] = get_cat_ID( ‘CategoryName3’ ); $my_query = new WP_Query( array( ‘category__and’ => $catIDs ) ); if( $my_query->have_posts() ) : while( $my_query->have_posts() ) : $my_query->the_post(); ?> <li> <a href=”https://wordpress.stackexchange.com/questions/125935/<?php the_permalink(); … Read more

Displaying Results From Custom Taxonomy Query

$regions = get_terms(‘region’, array(‘hide_empty’ => false) ); foreach( $regions as $region ){ ?> <li class=”location large-3 columns”> <img src=”https://wordpress.stackexchange.com/questions/126131/<?php echo get_template_directory_uri(); ?>/images/<?php echo $region->slug; ?>.jpg” alt=”” /> <span class=”location-title”><?php echo $region->name; ?></span> </li><?php }

How to mark every 3rd post

My approach. No extra function, no filter. 🙂 <?php $GLOBALS[‘wpdb’]->current_post = 0; ?> <div <?php post_class( 0 === ++$GLOBALS[‘wpdb’]->current_post % 3 ? ‘third’ : ” ); ?>> Alternative: <div <?php post_class( 0 === ++$GLOBALS[‘wpdb’]->wpse_post_counter % 3 ? ‘third’ : ” ); ?>>