array_replace throwing php_warning but working anyway

$term_object->order tells you $term_object is an object. array_replace() expects an array, not an object. Not sure why it works, maybe PHP is casting the object to an array. array_replace( $term_objects, (array) $term_object ); … could fix the warning.

get_term_link not working

That field can return multiple term objects depending on how you’ve got it configured, so I’ll guess that $series in this case is an array containing a single element, which contains your term object. Try inspecting the contents of series: print_r( $series ); You’ll probably see something like: Array ( [0] => stdClass Object ( … Read more

input radio ‘checked’ saves, but select option ‘selected’ doesn’t

It was a long way around to get there but you basically have a markup error. You didn’t name your select. You should have: <select id=”select-taxonomy” name=”<?php echo $name ?>”> // <– here is the change <?php foreach($terms as $term) { $id = $taxonomy.’-‘.$term->term_id; $value= (is_taxonomy_hierarchical($taxonomy) ? “value=”{$term->term_id}”” : “value=”{$term->term_slug}””); echo “<option id=’in-$id’ “. selected($current,$term->term_id,false) … Read more

How to Display Posts From Category Within a Custom Taxonomy?

@Krzysiek answer above didn’t work because have_posts is a method not a property. It should be have_posts() not have_posts. Here’s the corrected code: $my_query = new WP_Query( array( ‘post_type’=>’news’, ‘posts_per_page’=>4, ‘tax_query’=>array( array( ‘taxonomy’=>’instituteName’, ‘field’=>’slug’, ‘terms’=>’businessschool’ // change to real slug ) ) ) ); while ( $my_query->have_posts() ) { $my_query->the_post(); // display post }

Get posts from multiple tax terms

I honestly don’t see how that works at all since get_the_term_list returns an HTML string. First, you need get_the_terms and wp_list_pluck. Second, you need a tax_query. That {tax} = {term} pattern is deprecated. $this_post = $post->ID; $args = array( ‘post_type’ => ‘dir_entry’, ‘posts_per_page’ => 10, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘post__not_in’ => array($this_post), ); … Read more