Displaying posts by year
Displaying posts by year
Displaying posts by year
I’ve run into this problem with PageNavi before. My solution is to hijack the $wp_query variable temporarily and then reassign it after closing the loop. An exmaple: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args=array( ‘post_type’=>’post’, ‘cat’ => 6, ‘posts_per_page’ => 5, ‘paged’=>$paged ); $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query($args); /* … Read more
Special Query: Title, Terms, Content – %LIKE%
Listing custom post type items from a couple of custom taxonomies
It depends a bit on what are your exact status slug and title and page title are, but something like this should work, if I understand you correctly: $page = get_page_by_title($status->name.” tickets”); echo ‘<li><a href=”‘.get_permalink($page->ID).'”>’ .$status->name.’ (<span>’.$counts[$status->slug].'</span>)</a></li>’;
I’ve solved the problem myself though it is probably not be the right way to do it. Note that I’ve had to type “website-address” instead of the actual URL because system here won’t let me use more than one URL in a post without more reputation. That makes it quite difficult to convey what’s actually … Read more
Retrieve post data via WPDB class
Got the idea from this post to change my query : How to “orderby” the first array in a meta_query that uses multiply keys? I moved the state query into the larger array of queries, freeing the ‘meta_key’ value to be assigned to event date $args = array( ‘post_type’ => ‘tf_events’, ‘meta_query’ => array( $relation, … Read more
Complex WP_Query Using Post Date And Post Meta
I’ve run into this problem with PageNavi before. My solution is to hijack the $wp_query variable temporarily and then reassign it after closing the loop. An exmaple: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args=array( ‘post_type’=>’post’, ‘cat’ => 6, ‘posts_per_page’ => 5, ‘paged’=>$paged ); $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query($args); /* … Read more