Archive page with multiple taxonomies rewrite

ok, so I thought I’d come back and answer my own question in case its useful to someone else. To start, the CPT: ‘query_var’ => true, ‘has_archive’ => false, ‘rewrite’ => array( ‘slug’ => ‘resources’, ‘with_front’ => false ), Tax1: ‘query_vars’ => true, ‘rewrite’ => array( ‘slug’ => ‘resources/type’, ‘with_front’ => false ) Tax2: ‘query_vars’ … Read more

Changing the priority of a custom taxonomy’s metabox

As is often the case in WP, there are a number of ways to attack this problem. Here’s one possible way: function my_meta_box_order() { global $wp_meta_boxes; $genre = $wp_meta_boxes[‘post’][‘side’][‘core’][‘genrediv’]; unset($wp_meta_boxes[‘post’][‘side’][‘core’][‘genrediv’]); $wp_meta_boxes[‘post’][‘side’][‘core’] = array(‘genrediv’ => $genre) + $wp_meta_boxes[‘post’][‘side’][‘core’]; } add_action(‘add_meta_boxes_post’, ‘my_meta_box_order’); # We’re hooking into: do_action(‘add_meta_boxes_’ . $post_type, $post); $wp_meta_boxes holds all the meta box information. … Read more

How to get first post in a category of a custom taxonomy

tax_query takes an array of tax query arguments arrays (it takes an array of arrays) but you are using only single array. The correct code is as following. <ul class=”product-categories”> <?php $categories = get_terms( array( ‘produkter’ ), array( ‘hide_empty’ => false, ) ); foreach( $categories AS $cat ) { $taxonomy = new WP_Query( array( ‘posts_per_page’ … Read more

Best pratice to make taxonomy terms translatable without changing slugs?

I’m not really up to date on WPML and how it handles translations, but my general understanding is that in most cases it simply creates duplicate entries for each language and links them together with the “original”. However, I recently hade a similar problem where I needed the ability to add a “pluralized” version of … Read more