Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Breadcrumbs error (custom post types/taxonomies) #1088

Closed
MrAndreius opened this issue Sep 24, 2017 · 14 comments
Closed

Breadcrumbs error (custom post types/taxonomies) #1088

MrAndreius opened this issue Sep 24, 2017 · 14 comments

Comments

@MrAndreius
Copy link

PHP Notice: Trying to get property of non-object in \library\navigation.php on line 107

since the theme declare minimal support woocommerce

can use another function to display breadcrumbs?

96

  • OS & version: Win10 OpenServer
  • Node version (node -v) Latest
  • FoundationPress version Latest
  • Foundation version неважливо
@MrAndreius
Copy link
Author

by the way
if there are more than three items in the list
then the fourth, the fifth, etc.
do not stand out in bold

@olefredrik
Copy link
Owner

@JPOak You know if this issue might be related to #1086 ?

@JPOak
Copy link
Contributor

JPOak commented Sep 25, 2017

@olefredrik It shouldn't. @MrAndreius are you using another plugin for breadcrumbs? Are you using a plugin for custom permalinks? Did you try on one of the default themes and see if it works as expected for your situation?

@dantahoua
Copy link
Contributor

For Breadcrumbs, I found that if you have a lot of special Custom-Post and Taxonomies, the best way is to use the Yoast breadcrumbs part (from which I think the one in FP is inspired).

@colin-marshall
Copy link
Collaborator

@MrAndreius we need more info to be able to reproduce the bug. Please tell us the steps you took to get there.

@MrAndreius
Copy link
Author

@olefredrik @colin-marshall
no
It's not related #1086
because it's used line 90 --- $category = get_the_category(get_the_ID());
and it returns the result only for standard categories
there nailed down "taxonomy=categories" and with third-party plug-ins you need to request taxonomy=product_cat, taxonomy=team_cat, taxonomy=event_cat

and so on

:\ I think first you need to get the content type, and then request its category

@MrAndreius
Copy link
Author

MrAndreius commented Sep 25, 2017

@colin-marshall
install WP
install FP theme
install WOO
import demo products
add to woocommerce.php (in theme root folder) code line <?php foundationpress_breadcrumb(); ?>
GO to product page and look error

@MrAndreius
Copy link
Author

MrAndreius commented Sep 25, 2017

@colin-marshall
install WP
install FP theme
install CPTUI
add custom post type Team
add custom tax team-category
add to single.php code line <?php foundationpress_breadcrumb(); ?>
add team category Boss
create team member Jon Doe and attach him to category Boss
GO to team member page and look error

99

@colin-marshall
Copy link
Collaborator

@MrAndreius our breadcrumbs code came from here:
https://www.thewebtaylor.com/articles/wordpress-creating-breadcrumbs-without-a-plugin

The post has been updated to support custom post types and taxonomies after it was adapted for FoundationPress. We just need to make the updates they have in the new example.

@colin-marshall colin-marshall changed the title Breadcrumbs error (in woo product page) Breadcrumbs error (custom post types/taxonomies) Sep 25, 2017
@nitrokevin
Copy link

Yeah I used that updated code in a recent project and it worked fine with CPTs

@MrAndreius
Copy link
Author

MrAndreius commented Sep 26, 2017

@colin-marshall
there in thewebtaylor.com/articles/wordpress-creating-breadcrumbs-without-a-plugin
// If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)
it's a crutch :'(
this works for WOO
this can be used one-time, for yourself, but when you do not know what plugins are already there or tomorrow admin will install ....
It will not work for categories of other content types
the content type is displayed instead of the categories
shows
homepage > team > Jon Doe (a ring link, the page refers to itself, bad seo)
but it is necessary (or desirable)
homepage > team > Boss > Jon Doe
or
homepage > Boss > Jon Doe

it might be worth looking at https://github.com/justintadlock/breadcrumb-trail and use this code ?

@colin-marshall
Copy link
Collaborator

@MrAndreius as many people won’t even use breadcrumbs, im not sure how in depth we should support it. For now I would say we should support regular posts and WooCommerce but beyond that you should use a plugin for custom post types and taxonomies.

@JPOak
Copy link
Contributor

JPOak commented Sep 27, 2017

@colin-marshall I totally agree. I was going to say something before but figured it was not my business. I would in fact remove the breadcrumbs code as it doesn't really work anymore anyways. There are a lot of other solutions like Yoast etc. for breadcrumbs. I'd much rather we spend time on making sure the "starter" theme is semantic and the build system is rock solid.

@colin-marshall
Copy link
Collaborator

@JPOak don't ever be afraid to speak up, the opinion of every user of FoundationPress is valued. We also want as many comments on stuff like this as possible so we can make the best decisions for the project.

After looking further at that breadcrumb code, I also think it would be best to just remove it. It was copy pasted from that post and not even really adapted to Foundation's breadcrumb component. There's lot of unnecessary classes.

I put in a feature request at justintadlock/breadcrumb-trail#33 to add options for custom classes and data-attributes to make it very easy to use that plugin with Foundation's breadcrumb syntax. Sounds like it's going to happen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants