How to get custom post type menu_name?

Hi @mike23: This code shows you how to get both singular and plural names (assuming you specified them as such in your register_post_type()). Note that the code example is presented as a standalone file you can save as test.php file in the root of your website and load in your browser with http://yoursite.com/test.php (assuming you … Read more

Custom Taxonomy Hierarchy for Custom Post Types (eg Categories and Subcategories)

Hierarchical refers to the terms relation to each other not the taxonomies relation to another taxonomy. Non hierarchical taxonomies are like tags they don’t have parents or children. Hierarchical taxonomies means that the terms can have parents and children. taxonomy = category category terms: blue products (parent term) light blue products (child term) dark blue … Read more

adding .current* tags to custom post types and taxonomies

The classes are not added by the Twenty Ten theme, but by the common custom navigation menu code, in _wp_menu_item_classes_by_context(), which is called from wp_nav_menu(). If you want to add extra classes you can do that by either hooking into wp_nav_menu_objects, called once with the whole menu tree, or into nav_menu_css_class, called when rendering each … Read more

Post the content of a specific “Custom Post Type” post within a post using a shortcode

I would suggest creating a new custom taxonomy for relations between a post and its “tracks” or grouping of track posts if you’d like that way you can easily create a shortcode that will query all the needed tracks at once using a shortcode instead of calling your shortcode over and over and to order … Read more

Using WPAlchemy metabox values in another metabox

Ok, I finally managed to solve that by myself. It is possible thanks to : Create the first field : <?php while($mb->have_fields_and_multi(‘types’)): $mb->the_group_open(); $mb->the_field(‘type’); ?> <input type=”text” id=”<?php $mb->the_name(); ?>” name=”<?php $mb->the_name(); ?>” value=”<?php $mb->the_value(); ?>” /> <a href=”#” class=”dodelete button”>Remove</a> <?php $mb->the_group_close(); endwhile; ?> <a href=”#” class=”docopy-types button” style=”float: left”>Add new</a> <a href=”#” class=”dodelete-types … Read more

Posts created in a Custom Post Type are lost if published without a title

The function that’s in charge of saving posts on the database (wp_insert_post) requires at the minimum a title and content: http://codex.wordpress.org/Function_Reference/wp_insert_post Edit: I created a quick and dirty jquery solution. Input this in your functions file or in a plugin: <?php add_action(‘admin_head’, ‘post_title_check’); function post_title_check() { ?><script type=”text/javascript”> jQuery(document).ready(function($) { $(‘input[name=”save”]’).click(function() { if($(‘input[name=”post_title”]’).val() ===”) { … Read more