How to get tags with custom taxonomy field?
Have you try $tags = wp_get_post_tags($post->ID); ? <?php foreach($tags as $tag): ?> <span class=”tag-element”> <?=$tag->name ?>, </span> <?php endforeach; ?>
Have you try $tags = wp_get_post_tags($post->ID); ? <?php foreach($tags as $tag): ?> <span class=”tag-element”> <?=$tag->name ?>, </span> <?php endforeach; ?>
Here’s the code. You can change $post_type and $custom_fields according to your needs. function extend_admin_search( $query ) { // Extend search for document post type $post_type=”document”; // Custom fields to search for $custom_fields = array( “_file_name”, ); if( ! is_admin() ) return; if ( $query->query[‘post_type’] != $post_type ) return; $search_term = $query->query_vars[‘s’]; // Set to … Read more
You can try this : add_action( $terms.’_add_form_fields’, ‘___add_form_field_term_meta_text’ );
First of all, what you’re calling $current_tax would more appropriately be named $current_term. The taxonomy is ‘game’. Secondly, what you’re trying to do is basically adding term metadata. There already are several plugins that provide the custom table and functions for that. I recommend Simple Term Meta.
The issue at first glance appears to be here.. add_action(‘game_edit_form_fields’, ‘game_form_fields’); add_action(‘game_add_form_fields’, ‘game_form_fields’); function game_form_fields($tag,$taxonomy) { Your function is expecting 2 vars to be passed from the hook, but your add_action calls default to 1.. Eg, this.. add_action(‘game_edit_form_fields’, ‘game_form_fields’); Is equal to this.. add_action(‘game_edit_form_fields’, ‘game_form_fields’, 10, 1 ); The fourth parameters sets how many arguments … Read more
I found out that it is the plugin i am using and have instead decided to use the register function
Not possible in WP 3.2.1. See here http://codex.wordpress.org/Function_Reference/get_pages under “Parameters” and “page_name”. I’m working on exactly the same thing, but it seems I’ll need to resort to to a custom query: http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query
Use get_terms($taxonomy, $args) $terms = get_terms(‘Fruits’); Codex page
If you are retrieving post(s) by ID, then why do you need terms in query? Post IDs are unique. You likely need post type (because it’s not default), but taxonomy terms only add confusion to the mix. Update Noticed after you added second code sample – post__in has two underscores in it, your examples lack … Read more
Before the loop starts use query_posts. Available parameters are here. Something like this: global $wp_query; query_posts( array( ‘post_type’ => ‘mycustomname’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘mytaxonomyname’, ‘field’ => ‘slug’, ‘terms’ => array( ‘myterm1slug’, ‘myterm2slug’ ) ) ) ) );