Getting the correct value for a post

I’ve added correct indenting to your question, which should make the problem more obvious. The problem is that you meant: foreach ( $state as $state ) update_post_meta($post_id,’state’,$state->name); What you actually put is: foreach ( $state as $state ); update_post_meta($post_id,’state’,$state->name); Which expands to: foreach ( $state as $state ) { // do nothing } //insert post … Read more

Strip post_tags from list of returned taxonomy terms

Use this function to determine if Taxonomy is hierarchical or not: Function Reference/is taxonomy hierarchical « WordPress Codex Example: // taxonomy term archives $post_type = get_post_type(); $taxonomies = get_object_taxonomies($post_type); if(!empty($taxonomies)){ foreach($taxonomies as $taxonomy){ // only want hierarchical — no tags please if(is_taxonomy_hierarchical($taxonomy)){ $terms = get_terms($taxonomy); if(!empty($terms)){ echo “<ul>”; foreach ( $terms as $term ) { … Read more