Create monthly archive for parent category

Alright, I solved it: I queried the year and month of the page we’re on with: $year = get_query_var(‘year’); $monthnum = get_query_var(‘monthnum’); And then I added date parameters to each WP_Query: $col1 = new WP_Query( array( ‘year’ => $year, ‘monthnum’ => $monthnum, ‘posts_per_page’ => 1, ‘cat’ => 31 ) ); This allows me to split … Read more

How to create an array with category ids order by the one that has the most recent post

You could try $slidercategories_array = array(3,5,6,9,10,11,12,23,24,27); $in = implode( ‘,’, array_map( ‘absint’, $slidercategories_array ) ); global $wpdb; $sql = $wpdb->prepare( ‘SELECT tt.term_id, MAX(p.post_date) AS max_date FROM ‘ . $wpdb->term_taxonomy . ‘ AS tt ‘ . ‘ JOIN ‘ . $wpdb->term_relationships . ‘ AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id’ . ‘ LEFT JOIN ‘ . $wpdb->posts … Read more

Category as subdomain

Some of your resources are not loading properly, even on your main domain. Using Google Chrome, load your main page, open the Elements Panel by hitting the F12 key. In the panel that opens, look in the upper right corner. There will be a red X with a number next to it. That shows you … Read more