How to noindex nofollow custom post type?
Answering my own question here: The WordPress SEO plugin provides a menu for all posts and pages, including custom post types, that includes noindex and nofollow options.
Answering my own question here: The WordPress SEO plugin provides a menu for all posts and pages, including custom post types, that includes noindex and nofollow options.
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
Look in your database, it’ll be in the posts table under the post_type column for each product. Or alternately- search the plugin files for calls to register_post_type. Or depending on how the plugin works on the admin side, the URL of the edit screen may tell you: edit.php?post_type=some_post_type
Personally I would structure it like a CPT for each Hotels, Attractions, Restaurants. Then a custom taxonomy that ties them together for instance “Places” with children like “Locations”, etc. If the site has a lot of connected data it is a really good idea to sketch out the relationships on paper or using software like … Read more
The problem is probably due to clashes in the menu_position argument when registering a post type. Try editing those to values between the standard multiples of 10 and see if it solves the problem.
You only need to define two post types: ‘piece’ and ‘person’ and a connection field ‘role’. See https://github.com/scribu/wp-posts-to-posts/wiki/Connection-information
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
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
This sounds like a good idea as it would let you query by location etc. I don’t know what you plan to use the co-ordinates for, but it makes no sense to have them attached to an event (unless that event is a one-off in the middle of a field, but I guess that would … Read more
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.