Select Venue from dropdown list and reuse stored address information in meta_box

You’re already storing the venue, so you should be able to simply extract from an array front-side based on what a get_post_meta call returns. If i’m following you correctly still at this point, something along these lines should do the trick. function get_related_event_data( $venue, $field = ‘all’ ) { $event_data = array( ‘Spruce Gallery’ => … Read more

Display metabox title for custom fields with values

You can add another simple foreach loop to check if you have any values first: foreach ( $meta_boxes as $metabox ) { $has_value = false foreach ( $metabox[‘fields’] as $field ) { $meta = get_post_meta($post->ID, $field[‘id’], true); if(!isset($meta[0])){ $need_title = true; break; } } if ($has_value){ echo $metabox[‘title’]; foreach ( $metabox[‘fields’] as $field ) { … Read more

One Custom Post Type two different Templates

Yes it is possible. You’ll have to write a custom rewrite rule for making the domain.com/cpt/metaboxes url to be accessible. Lets say your cpt is ‘movie’, its single will be accessible as domain.com/movie/slug. Create a new page named ‘Metaboxes’ (slug should be ‘metaboxes’). Add the following code to functions.php. <?php add_action(‘init’, ‘add_my_rule’); function add_my_rule() { … Read more

Custom loop attached to link

Something like this: Make an URL like /companies/?leaders Than in your archive template (top): if(isset($_GET[‘leaders’])) { global $query_string; $query_string = $query_string . ‘&meta_key=leaders&meta_value=yes’; query_posts($query_string); } Hope this helps.

List of all posts in one custom post type in the edit screen of another

if you are trying to make ralationship links between post types, the easiest way is to use the great “posts 2 posts” plugin by Scribu : http://wordpress.org/extend/plugins/posts-to-posts/ here is the documentation : https://github.com/scribu/wp-posts-to-posts/wiki hope that could help. seb. EDIT : Is there a way to list all the posts created under one custom post type … Read more

Can I include get_posts in this array?

I’m assuming there is an option in the array that is meant to receive an array of options for the checkboxes…? In which case, you can use get_posts to obtain an array of post objects (of which ever type), and then loop through this, to create an array of post titles: For example.. $args=array(‘numberposts’=>-1,’post_type’ => … Read more