Using Advanced Custom Fields Relationship Field to select a taxonomy term

This is based on the assumption that you have a custom field called “show_on_tax” for the custom taxonomy “Directory Entry Type”, which appears when editing a small banner (See image below). This allows you to select which custom tax terms you want the banners to appear on. This should get you sorted but drop a … Read more

Custom Columns for Custom Post Type Manager

add_action(‘manage_edit-pricing_columns’, ‘manage_pricing_columns’); add_action(‘manage_pricing_posts_custom_column’, ‘manage_pricing_custom_columns’); function manage_pricing_columns($_columns) { $new_columns[‘cb’] = ‘<input type=”checkbox” />’; $new_columns[‘title’] = _x(‘Pricing Item’, ‘wp’); $new_columns[‘categories’] = _x(‘Type’, ‘wp’); $new_columns[‘date’] = _x(‘Created’, ‘wp’); return $new_columns; } function manage_pricing_custom_columns($column, $post_id){ global $post; switch($_columns) { case ‘pricing_type’: $pt = get_the_terms( $post_id, ‘pricing_type’ ); echo $pt[0]->name; break; default: break; } }

Search only custom taxonomies

Create a search form that submits a field called “name”. In the file that handles form submissions, // get the “name” the visitor searched for $term = $_POST[‘name’]; // query: find all posts with the ‘people’ taxonomy set to the “name” they searched for $args = array( ‘post_type’ => ‘post’, // or insert your custom … Read more

Display Custom Post Types Glossary

I used this code to create a glossary for a custom pos called “store”. So you can use it just replacing the “store” by “book”. Put this code in the loop of the page template you will be using for the glossary. $last_char=””; $args=array( ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘posts_per_page’=>-1, ‘post_type’ => ‘store’ ); … Read more