Contact Form 7 – Populating dropdown list with terms relative to the post

Use the dynamic_dropdown tag functionality offered by the Smart Grid layout extension. The dynamic tag can take 3 sources of data (a given taxonomy, or branch within that taxonomy, a list of post titles, or the results of a filtered hook function). Use the filter hook to populated your dropdown as, add_filter(‘cf7sg_dynamic_dropdown_custom_options’, ‘filter_options’,10,3); function filter_options($options, … Read more

Problem with query_posts for a custom taxonomy in theme options

I see three things. if ( function_exists( ‘of_get_option’ ) ) : query_posts( ‘cat=” . $homepage_feature = of_get_option( “homepage_feature’ ) . ‘&posts_per_page=3’ ); You have a syntax error. There is no endif;. Maybe that is a typo, but maybe not. If you are trying to write a one-line if, remove the colon. Your title states “custom … Read more

Website bookmarks as a custom post type

Here’s a clean way to accomplish what you need. Register custom post types (sans post_tags and categories) Register taxonomies specific to your bookmarks Create a post meta box for the bookmark options (sample included). You could add a nofollow checkbox option to the meta box. Save post meta Here’s the whole shabang. add_action(‘init’, ‘bookmark_post_type’); function … Read more

Display custom taxonomy for product

Instead of using wp_tag_cloud pls try this in product page <?php $terms = get_the_terms( $post->ID , ‘city’ ); foreach ( $terms as $term ) { $term_link = get_term_link( $term, ‘city’ ); if( is_wp_error( $term_link ) ) continue; echo ‘<a href=”‘ . $term_link . ‘”>’ . $term->name . ‘</a>’; } ?>

Separator for multiple terms

If you need just the term names, fetch just the term names: use the field parameter for get_terms(). Build a comma separated list with an and between the last two items with wp_sprintf_l(). // get the term names $term_names = get_terms( ‘department’, array ( ‘fields’ => ‘names’ ) ); // glue the names with comma … Read more

Custom Taxonomy List links being re-written

After taking @Milo ‘s comments into consideration, I removed the s= argument from the link, and it worked! This is my final code: function job_listing_taxonomy_list( $taxonomy,$hide ) { $args = array(‘order’=>’ASC’,’hide_empty’=>$hide); $terms = get_terms( $taxonomy, $args ); if ( $terms ) { printf( ‘<ul name=”%s”>’, esc_attr( $taxonomy ) ); foreach ( $terms as $term ) … Read more