how to show more than 1 post into three columns query

I haven’t tested it but see if that works Assign values to variables before begining of while loop $c = 1; $counter = 5; Change your all $couter if conditions if($counter == 1) if($counter == 2) if($counter == 3) into this respectively if($counter % $c==1 || $counter % $c==2) if($counter % $c==3) if($counter % $c==4 … Read more

Show posts for current taxonomy

From the above query, it seems that you have passed wrong parameters in tax_query of your query. It should be as follows: ‘tax_query’ => array( array( ‘taxonomy’ => ‘Themes’, //Your custom taxonomy slug ‘field’ => ‘slug’, // this should be field name, not field value ‘terms’ => array(‘environment’), ‘include_children’ => true, ‘operator’ => ‘IN’ ), … Read more

WordPress redundant posts based on meta field

I ended create another custom post type to manage the schedule and I created a relation to the existing films custom post type: – Films (all films without tv guide) – TV schedule (each post represents time in the tv guide and can only be related to one movie). I then enabled future posts to … Read more

Adding comma to while loop wpquery output

Try with this: <?php $args = array( ‘post_type’ => ‘product’, ‘post_status’ => ‘publish’, ‘meta_key’ => ‘views’, ‘orderby’ => ‘meta_value_num’, ‘order’=> ‘DESC’, // sort descending ); // Custom query. $query = new WP_Query( $args ); // Check that we have query results. if ( $query->have_posts() ) { // Start looping over the query results. while ( … Read more

How to create loop in custom page, and get id from url into this loop?

basically what you want to do is get the id from $_GET[‘id’] then you can use the WP_Query <?php wp_reset_postdata(); $args = array( ‘category’ => $_GET[‘id’], ‘order’ => ‘DESC’, ); $query = new WP_Query($args); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); //do your stuff here…………………. endwhile; endif; ?> here $_GET[‘id’] will … Read more