How can I style future post?

Just use the function get_post_status(). Inside the loop you have access to the Post Id, but if you leave this blank it will use the ID of the current post instead. So you code will become something like this (not tested yet): <h3 class=”entry-title td-module-title”> <?php if( get_post_status() != ‘future’ ) { ?> <a href=”<?php … Read more

Alter secondary loop to exclude posts from current page category

This one is even more simple. Refer to the WP_Query() category parameters. I think you will want to use ‘category__not_in’. foreach ( $random_posts_cat_array as $random_post_cat ) { if ( $post_cat_slug == $random_post_cat ) { // No posts from this category! $random_posts_query_args[‘category__not_in’] = $post_cat_id; } } Edit So for example if a post is currently on … Read more

Custom Taxonomy List links being re-written

After taking @Milo ‘s comments into consideration, I removed the s= argument from the link, and it worked! This is my final code: function job_listing_taxonomy_list( $taxonomy,$hide ) { $args = array(‘order’=>’ASC’,’hide_empty’=>$hide); $terms = get_terms( $taxonomy, $args ); if ( $terms ) { printf( ‘<ul name=”%s”>’, esc_attr( $taxonomy ) ); foreach ( $terms as $term ) … Read more

How to display child posts in the parent category

You need to use a tax_query with WP_Query. With a tax_query, by default, child terms are included to the term being set. Here is the example- $args = array( ‘post_type’ => ‘post’, // Your post type ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘rankk’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 100, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, … Read more

Display different number of posts from one category on the different pages

You can check for the existence of a variable, so you don’t overwrite it: add_action( ‘pre_get_posts’, ‘wpse7262_pre_get_posts’ ); function wpse7262_pre_get_posts( &$wp_query ) { if ( $wp_query->is_category() ) { if ( ! array_key_exists( ‘post_type’, $wp_query->query_vars ) ) { $wp_query->set( ‘post_type’, ‘game’ ); } if ( ! array_key_exists( ‘posts_per_page’, $wp_query->query_vars ) ) { $wp_query->set( ‘posts_per_page’, 9 ); … Read more

Custom WP_Query breaks default behaviour of viewing right post associated with tax-term!

You second query performs an entirely new query and does not have the terms set. Besides, it’s not as efficient to ‘redo’ the query. Instead, hook into pre_get_posts and change the order there: function change_order_for_events( $query ) { //Check if currenty query is the ‘main query’ and event type taxonomy being viewed if ( $query->is_main_query() … Read more