Your custom post type matches the conditional is_single()
, so this part is trying to output the category the post is assigned to, which I’m assuming doesn’t exist:
if (is_category() || is_single()) {
$category = get_the_category();
$crumbs .= '<span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" href="'.get_category_link($category[0]->cat_ID).'">'.$category[0]->cat_name.'</a></span>';
}
either check if $category
contains a category, or change is_single
to just check the post
post type:
if (is_category() || is_singular('post')) {
Related Posts:
- How to throw error to user when saving post
- wordpress plugin error handling
- How can I fix those issues generated by the Themecheck plugin
- Undefined property: stdClass::$labels in general-template.php post_type_archive_title()
- If on term-page -> get the current term?
- The editor has encountered an unexpected error. // TypeError: Cannot read property ‘prefix’ of null
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- Custom Taxonomy Breadcrumb Navigation
- wp is not defined error using wp.media to create a custom image uploader
- Get the posttype of a taxonomy/term
- Check Title Unique Or Not and If not error message and dont save
- How to determine if custom post type showing on archive templates
- Custom post type not displayed in breadcrumbs on archive page
- Notice: Undefined index: error and understanding wordpress
- Illegal offset type in get_post_type_object()?
- Trouble with CPT Child 404
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Breadcrumb Not Linking to the Correct Custom Post Type Index Page(s)
- Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
- Query not work for current taxonomy
- Using breadcrumb to return from single-page to list
- Problem retrieving informations and displaying desired structure with custom post type and taxonomy
- Custom Post Type Causes Error: Warning: call_user_func_array()
- Multiple categories assigned to a single product breaking the breadcrumb
- Link custom post type to parent page and show in slug / breadcrumb
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- Post template with breadcrumb needs to show page navigated from
- I have a random letter appearing before my content. Where to start looking for the cause?
- “A post type mismatch has been detected” Error when updating custom post
- Custom post type archive false is not compatible with breadcrumbs
- WooCommerce breadcrumb display custom posts instead of product data
- Error [Column ‘post_title’ cannot be null] when title is disabled for Custom post type
- Breadcrumb that shows multiple custom taxonomies
- How to retrieve taxonomy terms of the current custom post?
- Notices when submitting custom post type from front-end
- how do I create a breadcrumb to work with multiple custom taxonomies
- custom post type breadcrumb error when has_archive = false
- Custom Post Type slug has the same Redirection entry
- Get post with multiple meta keys and value
- Custom Post type in separate database table for syncing
- Why would WordPress use ‘attachment’ in a custom post type’s query string?
- Creating Photo Gallery System with Custom Post Type
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- Custom Post Type With Different Views
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- Correct way to use a form to to filter custom posts by taxonomy terms?
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Custom post-type in root directory, blog posts in subdirectory
- How can I include meta box content when searching?
- List all custom post type posts from a given category?
- Get all posts WHERE custom_field is LIKE value
- Filter home_url for custom post type
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Create custom post type on successful woocommerce order [closed]
- How to create a json API for my custom post type
- Display custom post type in hierarchical order with get_terms
- Creating a Page to View the List of Posts for a Custom Post Type?
- Am unable to reset a query properly
- Registering different Post Formats for Blog Post and CPT
- Custom post type (with parent-child relationship) singular page with pagination
- Creating a navigation menu of all posts of a custom post type and their children posts?
- Filter custom posts using auto populated dropdown selectors
- Update post meta not working in transition_post_status
- Display Custom Toxonomy In WordPress and theme Widgets category selection dropdown list
- How to change the post type a theme shows by default?
- Update database from Quick Edit according to Checkbox state of Custom Post Type
- Convert comments to Custom Post Type
- Is there any way to add a “custom field” to the CPT archive page?
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- WebP Fallback for Inline Background Image in Style Attribute
- Post to Top in Array
- Detect inside a custom query the kind of post type to assign custom classes
- Checking if looped item has a parent inside a shortcode
- Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
- Query all post and CPT from 2 specific taxonomies AND by ACF custom field
- Check if user has custom post published redirection on WordPress
- Custom post type permalink returns 404 when set to private
- Assigning alternate single-{cpt} template based on blog_id in multisite
- Custom Post Type – after disable ‘Add New’, I can’t edit and delete post
- How do I display child post types in the parent post type template
- How do I show my containing my custom field ONLY if there is a set value on that custom field? [closed]
- admin_head-post.php only works after publish / update
- shopping cart plugin development
- Add custom post type taxonomy tag to article class
- Custom Taxonomy dont save in a frontend form for post a custom post
- Setting Parent Page to Post
- Custom Post type dont use custom page template (slug is not right)
- Get the taxonomy value in the post loop inside the archive page
- Custom Post Type & Taxonomies – Rewrite
- Custom Post Type and Structure Question
- Do not show child pages within a file page
- Change CPT permalink to use the category
- Custom post types & Pages hierarchy – Error 404
- disabel for custom post Auto Upload Images
- Questions on WordPress Codex Concept
- Why is this custom post type defaulting to archive.php?
- How do I filter a custom post type loop by a field?
- How to order different custom post type in category or tag template page?
- How to manage wordpress knowledge base/wiki/posts collections
- selecting custom post types and taxonomies for hub page listing blocks