Articles of custom post types

Should i delete the posts created by a plugin on uninstall?

I created a plugin which is based on a Custom Post Type. When someone uninstalls this plugin, should i delete the posts under this post type or i should just leave them untouched?

Custom Post-to-Post with multiple parents?

I currently have a custom post type of “Faculty” – each faculty can have zero or many custom post type “Bibliographies,” and a bibliography can belong to one or more faculty. What is the best practice for setting up this association, and more importantly, is this possible still using the API? I’m testing this with […]

Display custom post type in template

I have a custom post type called campsites, events and activities I want to display this in a list. So when the user click on the link, it will then display all the posts under that custom post type. Any help would be greatly appreciated. Edit add_action(‘init’, ‘activity_resources_register_post_type’); function activity_resources_register_post_type() { register_post_type(‘activity_resources’, array( ‘labels’ => […]

previous_post_link() and next_post_link() with a custom post type?

I’m on single-work.php for a custom post type called work, inside the loop. Trying to make two links to the previous and next post. Using this code: <?php previous_post_link(); ?> and <?php next_post_link(); ?> But nothing shows up. Am I missing something Here is my code, very straightforward: <?php get_header(); ?> <div class=”full” > <?php […]

Get categories for a specific post – Custom post type

I’m trying to retrieve all the categories which are related to a specific post, using the wp_get_post_categories() function. The problem is that it is a custom post type, so I tried sending it in the $args array : wp_get_post_categories($id,array(‘post_type’=>’product’)); but that returned an empty array as well. What is the correct way of doing it?

How to stop wordpress from mangling HTML in a metabox textarea

Can anyone lend a hand and suggest the best way to get a textarea in a meta box to stop mangling HTML? I’ve been digging around here online… and here…and also here…looking for answers, but I don’t know how to piece them together properly to fit with what I’ve already done. Here’s what I have… […]

How can I display custom post types under multiple views?

I want to create custom post types with multiple views based on URL. E.g., suppose I have a “Product” post type. I would like to have something like the following: http://example.com/products/product_name <– Regular view of the product/regular template http://example.com/products/product_name/detailed <– Expanded view, extra info, more theme elements, widgets, etc. http://example.com/products/product_name/summary <– Quick view, less info, […]

Force unique page slugs across all post types

I have a site with many custom post types and I need a unique slug for each page. What I’m seeing is that wordpress only checks for slug conflicts within a post type before appending “-2”, “-3”. So I can have “actor/foo”, “book/foo”, “book/foo-2”. I don’t want that. I want each foo to have its […]

How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?

The default taxonomy, category. By default, only those with the edit_posts capability can assign categories during post creation/editing. I have a role with very limited capabilities. I want to let users in this role be able to assign categories during custom-post-type creation/editing, but I cannot give them the edit_posts capability and they should not be […]

Displaying Multiple Post types in Taxonomy

I have the following Custom Post Types which are all linked to the destination taxonomy. Deals Accommodation Attractions Articles How would I change the taxonomy-destination.php file to show matching posts from all 4 post types. For instance, when currently viewing the destination “los angeles”, it shows all this content together by date rather than separating […]