Web & Software Developer

Posts Tagged “WordPress custom post types”

Conditional Statement For a Custom Taxonomy

In a WordPress template, sometimes you want to do something only for one single term of custom taxonomy, not for all posts using the custom taxonomy. For example, say you’ve created a custom taxonomy, ‘Fruits’ and it has some terms: bananas, oranges, apples. And say you want to do something only for posts that have … Read more →

Assign Custom Post Type Capabilities to Roles in WordPress

This code assigns capabilities for a custom post type to existing user roles in WordPress without a plugin. This function is only needed if you used something other than ‘post’ for the ‘capability_type‘ argument when registering your new custom post type. If you didn’t specify a ‘capability_type’ other than ‘post’, then you do NOT need … Read more →