WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term

You can try: $the_query = new WP_Query( array( ‘posts_per_page’ => ‘5’, ‘v_sortby’ => ‘views’, ‘post_type’ => array( ‘post’, ‘music’, ‘videos’, ‘albums’ ), ‘tax_query’ => array( array( ‘taxonomy’ => ‘content’, ‘field’ => ‘slug’, ‘terms’ => array( ‘indy’ ), ‘operator’ => ‘NOT IN’ ) ) )); to exclude the indy term in the content taxonomy.

Pull in taxonomy links using get_the_terms?

You need to include your html inside the foreach, something like this: $url = site_url(); foreach ( $terms as $term ) { $linklist .= “<h3 id=’Proj_Categories’><a href=”” . $url . “/projects/” . $term->slug . “”>” . $term->name . “</a></h3>\n”; } echo “<ul>” . $linklist . “</ul>”; (I haven’t checked this code…) It looks like you … Read more

Mapping Subdomains in WordPress to give the appearance of a localised site, best approach?

Sort of a vague question, but I think I understand what you’re getting at. You’d need to use a WordPress Multisite installation, which will effectively create localized blogs on a subdomain (brisbane.example.com, perth.example.com). Using a single site WordPress installation to do this is possible, using CNAME mapping on the domain, however this would not suit … Read more

Locale switching with a “language” taxonomy

You might be interested in url_to_postid function Used as follows from your wpsx_redefine_locale function: $url = $_SERVER[‘REQUEST_URI’]; $postid = url_to_postid( $url ); Note that this does not return the post id for custom post types but the function is located in /wp-includes/rewrite.php and might be extended if needed. UPDATE: here’s your sample: function my_function(){ if … Read more

Display all posts for taxonomy term across multiple custom post types

You can do this with an array of post types and a tax query for your term. The question you linked had special requirements as only one of the post types used the taxonomy. $args = array( ‘post_type’ => array( ‘books’, ‘movies’, ‘shows’ ), ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘status’, ‘field’ … Read more

Categories sorting

You have orderby=count, which should be correct, but you also have order=asc. order=ASC means “smallest to largest”, at least with numbers. You want the opposite, “largest to smallest”. Use order=DESC instead. I suspect that get_terms is working, you’ve just told it something different that you actually want. Also, you have multiple queries in a loop … Read more

Changing taxonomy term by slug (wp_update_term)

As you hinted in your question, you could use get_term_by() to return an object or array containing the term’s id, then use it to update that term. Something like this should work: $your_term = get_term_by( ‘slug’, ‘your_slug’, ‘your_taxonomy’ ); if ( false !== $your_term ) { wp_update_term( $your_term->term_id, ‘your_taxonomy’, $args ); } References: http://codex.wordpress.org/Function_Reference/get_term_by http://codex.wordpress.org/Function_Reference/wp_update_term