Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode

The following code is partialy taken from the plugin Taxonomy Images and it’s working: function get_taxonomy_image( $atts ) { $atts = shortcode_atts( array( ‘image_size’ => ‘thumbnail’, ‘id’ => ”, ), $atts ); if( ! empty( $atts[‘id’] ) ) { $term = get_term( $atts[‘id’] ); $related_id = 0; if ( isset( $term->term_taxonomy_id ) ) { $related_id … Read more

Polylang non translatable custom taxonomy

It seems that the plugin Media Library Assistant is deliberately setting its custom taxonomy category_attachment as translatable by means of configuration file wpml-config.xml. Therefore changing the line <taxonomy translate=”1″>attachment_category</taxonomy> to <taxonomy translate=”0″>attachment_category</taxonomy> should do the trick. However I did not try myself because I’m not sure of what happens to existing taxonomy terms having a … Read more

Custom Taxonomy Tags and Category using same slug

So I got this working by adding /tag or /category for the rewrite slug, rather then publications or publications/%publications_tag%. I initally thought both taxonomy types could live in the parent post-type and wordpress would figure the rest out. Tags: ‘rewrite’ => array( ‘slug’ => ‘publication/tag’, ‘with_front’ => false ), Looks like: domain.test/publications/tag/example-tag/ and use’s the … Read more

wp_dropdown_categories() searching is not working with CPT, please review my code

Working drop down in search for CPT <?php $categories = get_categories(‘taxonomy=custom-tax’); $select = “<select name=”cat” id=’cat’ class=”postform”>n”; $select.= “<option value=”-1″>Select category</option>n”; foreach($categories as $category){ if($category->count > 0){ $select.= “<option value=””.$category->slug.””>”.$category->name.”</option>”; } } $select.= “</select>”; echo $select; ?> <script type=”text/javascript”><!– var dropdown = document.getElementById(“cat”); function onCatChange() { if ( dropdown.options[dropdown.selectedIndex].value != -1 ) { location.href = … Read more

i need to show featured post on custom taxonomy page

Syntax for your meta query seems to be wrong. Just as tax query, it should be array with array for each meta condition. Also use $query for your query functions: $args = array( ‘posts_per_page’ => 3, ‘post_type’ => ‘post’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘city’, ‘field’ => ‘term_id’, ), ), ‘meta_query’ => array( array( … Read more

WP_Query and DES sort for Custom Taxonomy based upon a meta field?

Nothing. You shouldn’t need to set the post type. Your taxonomy archive is presumably already querying the correct post type. function customize_customtaxonomy_archive_display ( $query ) { if ( $query->is_tax( ‘country’ ) ) { $query->set( ‘meta_key’, ‘start_date’ ); $query->set( ‘orderby’, ‘meta_value_num’ ); $query->set( ‘order’, ‘ASC’ ); } } Note: $query->is_main_query() is redundant when checking $query->is_tax(), because … Read more