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

Custom WP_Query breaks default behaviour of viewing right post associated with tax-term!

You second query performs an entirely new query and does not have the terms set. Besides, it’s not as efficient to ‘redo’ the query. Instead, hook into pre_get_posts and change the order there: function change_order_for_events( $query ) { //Check if currenty query is the ‘main query’ and event type taxonomy being viewed if ( $query->is_main_query() … Read more

Display Custom Taxonomy Terns ordered by meta_value

Assuming the position field is filled with numbers to give order: have a look at ksort. <?php $terms = get_terms(‘brands’); // Let’s create our own array and then reorder it $order_terms = array(); foreach( $terms as $term ) { $position = set_up_the_position_meta_here; $order_terms[$position] ='<h2>’.$term->name.'</h2>’; } // now lets reorder the array based on keys (position) … Read more