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_posts() return NULL using a custom plugin and add_submenu_page() with Post Type
- fehler beim laden des blocks: ungültige(r) parameter: attributes – Gutenberg
- Adding a new custom post type using the editor causes 502 bad gateway error
- Main query not querying any posts in custom taxonomy template
- Slug Confusion Between Post and Custom Post types?
- WordPress custom slug rewrite
- Which Template Page Should I Use?
- How to change path for default WordPress blog posts?
- Custom Empty Results page for my Custom Post Type
- How to find a specific post_type using its “rewrite slug”?
- CRUD operations in wordpress
- How to get a custom type post data when it has a connection with another custom type post?
- How do I create an overview page with custom calculations from a post-type?
- wp_insert_post wrong post type [closed]
- disable quickedit for specific custom post type user role
- custom post type template
- WordPress Picks Up Wrong Template for Custom Post Type Archive Page
- Get Post Terms of Current Post (selected taxonomy term) – How to get only the taxonomy value and not “Array ( [0] => taxonomy term )” in the frontend?
- Replace dynamically content in a custom database table when a custom post is created
- How to hyperlink content from archive page with custom post-type
- Add post meta programmatically to attachment
- Loop increase number
- custom post for slider
- Custom post type showing same Post on all Pages
- WP Query ‘posts_per_page’
- How to display custom post type tags?
- Featured image size in column
- Associate page w/ specific single post template?
- WordPress Custom Post Type – show only certain posts that have specific taxonomy set
- Multiple pages per post (not pagination)
- Submitting Custom Post Types with custom fields from Front-end form
- Custom WP_Query always respond with 200 status even when no entry
- Display custom post types in wp_list_pages
- Why would social icon badges disappear after adding a custom post type?
- Author posts not appearing for custom post type
- Custom Post Type Metadata Not Saving
- How to create multiple editor?
- get_post_meta is not working inside shortcode
- False Positive on has_post_thumbnail
- Sort a custom post with ACF: Date Picker & Display Featured!
- detect when a custom post is cretaed for the first time
- Custom post type, have only my meta boxes
- Custom Taxonomy not displaying all post
- Exclude current post for custom post type
- detect your custom post type in WordPress
- Add categories to a page with out using Custom Post Types
- How to limit post per page of custom post type?
- How to get all Custom Post Type Filtered by one Specific Taxonomy Term
- How to customize work area / admin area in a custom post type without plugins?
- Custom posts template page
- Display posts with tag for custom post type only
- Display Repeatable Meta Box Content
- How can i automatically add CPT single pages as sub menu items
- If there is only one post (show elements) else (show other elements)
- Conditional for post type inside loop (recent posts)
- Using wp_query to modify the loop in index.php for a CPT
- A Collection of Custom Post Types Displayed In a Submenu
- Category archive in with conjunction with custom post type is empty
- writing posts in indian regional language (Punjabi)
- Set thumbnail and title for a post type archive (not post itself!)
- the_post() is printing titles in page footer
- Use remove_meta_box conditionally on custom post type