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
- Adding a new custom post type using the editor causes 502 bad gateway error
- Query by post title
- Marking future dated post as published
- Custom Taxonomy as checkbox or dropdown
- WP insert post and custom taxonomy
- Assign a Custom Role to a Custom Post?
- Implementing “Video of the Day” Feature?
- how to group custom post types
- echo value from ‘select’ field type into page template using cmb2?
- Page as child in custom post type slug?
- Is it proper to create a page just to generate a listing page (eg. for a custom post type)
- How to quickly switch custom post type singular template?
- Post metadata deletes itself
- How to filter post data with AJAX on page?
- Best way to arrange custom post types by Attributes -> Order metabox value?
- Get latest 4 post on a custom post filtered by category
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- Separate Custom Post Type Taxonomy by Comma
- CSS for Custom Post Types
- How can you use custom types/taxonomies? [closed]
- Query post types with multiple keys
- Get child terms of current term of the current post
- Allow duplicate slugs for posts on Custom post type in different categories/taxonomy?
- Assign category to front end post
- How to generate a sitemap with custom posts (not Google XML)
- Remove Post Page “View Post” Link
- Turn query string to sub page
- WordPress Template Hierarchy
- Taxonomy structure of Sport site
- How can I add a column in the wp_list_table of the admin area?
- Custom Post Type with static page for archive
- How to filter the description of a custom post type
- Trigger “unsaved changes” dialog for custom post meta changes
- How does the $post_type global variable work?
- how to check if custom post type exists in wordpress
- Custom post type custom taxonomy archive page name
- Archive slider for CPT
- If Statement – if current post is a child of a post with a taxonomy
- Unable to retrieve any posts of CPT in wp-admin
- Custom Page that comes with preloaded content for the user
- Automatically update custom field in all posts of a custom post type
- Custom post type not showing in admin menu
- Custom taxonomy in custom post RSS feed
- Rewrite slug for CPT
- Custom post type templating problem
- How to set up a post word limit for a custom post type
- Custom Taxonomies not appearing in Admin
- How to create custom post type like Page
- Register widget only page is a singular of custom post type
- Which post does a taxonomy term belongs to?
- Can taxonomies of custom post types be used with category actions?
- Remove the parent slug in a CPT URL
- Custom Post Type – No Results Found
- Add custom field to Posts and sort by it
- 404 error when navigating to a taxonomy page with Cyrillic, what’s wrong?
- Including metaboxes from custom post types in global search — continued
- Custom post type as home page with custom url
- post tag texonomy rename getting error
- Creating a Custom Post Type
- Fixed values for same post translations
- How to give all CPT a folder automatically based on their slug
- How to make front end form only accept certain values