WordPress if in term*

http://codex.wordpress.org/Function_Reference/has_term So… <?php if ( has_term(‘products’, ‘your_custom_taxonomy’, $post ) ) { get_template_part(‘products’); } elseif ( has_term( ‘downloads’, ‘your_custom_taxonomy’, $post ) ) { get_template_part(‘downloads’); } ?> Change your_custom_taxonomy to whatever that taxonomy name is. I changed include to get_template_part. If this is found in a theme file, that’s the correct function to use. If it’s in … Read more

Dynamically add / duplicate custom meta in custom post types

I will answer myself after some research 🙂 while there might be appropriate ways of coding this with some custom function, for me there’s no need to reinvent the wheel when there’s a neat plugin that does the job it’s called “advanced custom fields” http://wordpress.org/extend/plugins/advanced-custom-fields/ it has a “repeater” to let admins add more fields … Read more

Redirect page for a custom post type

I don’t think you need a redirect. You are missing the rewrite rule for your custom post type. register_post_type(‘cp_clients’, array( ‘labels’ => array( ‘name’ => __(‘Clients’), ‘singular_name’ => __(‘Client’) ), ‘public’ => true, ‘has_archive’ => true, ‘supports’ => array(‘thumbnail’, ‘title’, ‘editor’) ‘rewrite’ => array(‘slug’=>’companies’) ); You should now be able to create and use single-cp_clients.php, … Read more

Custom post types columns strange issue

Worked it out! Since WP version 3.1 the hook for adding columns to custom post types has changed. Before 3.1 it was: add_action(“manage_posts_custom_column”, “testimonials_custom_columns”); After 3.1 you have to use this: add_action(“manage_testimonials_posts_custom_column”, “testimonials_custom_columns”); So you have to specify the custom post type name in the manage_post_custom_column hook. Hopefully this answer will save someone some time.