Articles of custom post types

Display posts with tag for custom post type only

I have this is my functions.php file to create tags only for custom post type called ‘image-gallery’: register_taxonomy( ‘image-gallery_tags’, ‘image-gallery’, array( ‘label’ => __( ‘Image Tags’ ), ‘rewrite’ => false, ‘hierarchical’ => false, ‘capabilities’ => array( ‘edit_terms’ => ‘manage_categories’ ) ) ); But I can’t get the list of tags to show in the post […]

New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?

I just noticed I have a “Custom Types” menu item on my wordpress backend (admin) menu. Picture: I tried disabling every plugin that has anything to do with custom post types and it was still there. So then I disabled every plugin in the backend and someone it is still there. New wordpress feature? Or […]

Can't use pagination with custom taxonomy

I have a problem with custom taxonomies & post types URLs. My post type slug is videos, it has an archive and it works fine: The pagination on the bottom of the page works like a charm. My taxonomy slug is video_type, but I rewrite the slug to be videos, than all the taxonomy […]

Can I restrict category availability?

Is it possible to restrict category availability, so that only specific categories are available in the category metabox on the edit post screen of a specific post type? Example: can a category of ‘foo’ be available on the edit screen for a specific cpt – but not the edit screen of regular posts? (I already […]

Use remove_meta_box conditionally on custom post type

I have a custom post type of people with some custom taxonomy boxes, i want to hide these when on child pages. I have found remove_meta_box works fine but i just can’t access the $post object within the action. Currently i have function remove_post_custom_fields($post) { global $post; if( count($post->ancestors) > 0 ){ remove_meta_box( ‘staff-typediv’ , […]

WP_Query tax_query on ACF post_object

I have a custom post type Wine, which has an ACF Field that links to another custom post type Producer as a post_object relation. In my Producer, I have a custom taxonomy named Region. Now, what I’m trying to do is to query all the white wines where the producer’s region is x. Here’s what […]

Custom post type archive page not working

I am trying to create a custom post type. All are working fine except archive page. My custom post type archive page is archive-courses.php but is is not working it is showing default archive.php . Is there any wrong in my code? Can anyone help me, please? function td_courses() { $labels = array( ‘name’ => […]

Category archive in with conjunction with custom post type is empty

I’ve set up a custom post type that works as intended: add_action( ‘init’, __NAMESPACE__ . ‘\\work_post_type’ ); function work_post_type() { // set up labels $labels = array( ‘name’ => ‘Work’, ‘singular_name’ => ‘Work’, ‘add_new’ => ‘Add New Work’, ‘add_new_item’ => ‘Add New Work’, ‘edit_item’ => ‘Edit Work’, ‘new_item’ => ‘New Work’, ‘all_items’ => ‘All Work’, […]

A Collection of Custom Post Types Displayed In a Submenu

I have WordPress 4.6.1. I now have experience with creating custom post types and see them stacked up in the admin UI console. But how can I create a stack all of my custom post types in a menu so that when I go to wp-admin, I see on the left, a button called My […]

Why does accessing url by category cause issues with post types?

I just built a site with a few CPTs (apple, banana, cucumber). My boss wanted to split them out into categories (red, yellow, green) and link to the category pages. As soon as we did and accessed the page via category in the URL, the page is not displaying correctly. Specifically, is displaying the […]