Articles of custom post types

After creating hierarchical post type, still not getting any way to set parent

After creating a custom post type like below, I still dont get any option to set the parent of the post, am I missing something? register_post_type( ‘projects’, array( ‘labels’ => array( ‘name’ => ‘Projects’, ‘singular_name’ => ‘Project’ ), ‘public’ => true, ‘capability_type’ => ‘post’, ‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’, ‘excerpt’, ‘comments’), ‘hierarchical’ => true, ‘menu_position’ […]

Associate Taxonomies Across Post Types

Let’s say I’ve created two custom post types, one called post_type_author and another called post_type_book. In each of these two custom post types, I’ve created a non-hierarchical taxonomy for tags. What is the best way to associate these two custom post type’s taxonomies? Also, if I wanted to link these two along with the default […]

How many Custom Post Types to register?

My current WordPress site only exists of pages. The structure is as simple as this: I want to use Custom Post Types to add listings about individual hotels, attractions and restaurants. The new structure will look like this: With myhotel/myattraction/myrestaurant being a Custom Post Type. All listings share the […]

WordPress if in term*

i am having trouble with conditional and custom post types. i would like to set something up like this: <?php if (in_term(‘products’)){ include (‘products.php’); }elseif (in_term(‘downloads’)){ include (‘downloads.php’); }else { //Nothing Happens }?> Obviously this doesnt work, but if there is an alternative anybody knows then please share 🙂 Thank you, Dan

Redirect page for a custom post type

I have the following 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’) ) ); I want to output custom content when the user calls It’s a plug-in and not a theme. Any ideas how I can […]

related posts – pulling tags from a specific post type

I’m currently using the following bit of code to display related posts on my single template. <?php $orig_post = $post; global $post; $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; $args=array( ‘tag__in’ => $tag_ids, ‘post__not_in’ => array($post->ID), ‘posts_per_page’=>5, // Number of related videos that will be shown. ‘caller_get_posts’=>1 […]

Custom Post Types: Can you add more than one Variable to a Column?

(Since my custom post type is a little long, I’ve for the sake of simplicity, copied over a dummy one) What I am trying to do is, say I describe a few “similar” variables, i.e. price1, price2, price3, etc. would I be able to stack those values in a single column (as opposed to showing […]

How do I create a form to search a custom post type

Basically how would I create a form to search only within a custom post type?

How do I fix permalinks for custom post types that has the same slug as a page?

I know that it’s impossible to have the same custom post type slug as a page. So, I thought it might be resolved in this way: ‘rewrite’ => array(‘slug’ => ‘my-category/!#’) for register_post_type But I get “Page not found” every time I visit /my-category/!#/title-1 As you understand, I also have a page named “/my-category”. Is […]

How To Create A Custom Taxonomy 404 Page

I can’t seem to find any documentation on this and Google is only showing results for people who have 404 pages caused by their incorrectly implemented taxonomies. I want to show a custom 404 page for my custom taxonomy. I would hope that there would be a simple naming convention like with taxonomy-{taxonomyName}.php. Maybe something […]