Closed hanyseyedy closed 2 years ago
hi @hanyseyedy,
Yeah indeed, second issue is due to the fact that you're using page
in your slug. As page is a base post-type. There is probably a better solution. I need to think about it.
In regards to the first issue, I will do a bit of testing, when I developed it initially, I didn't need to handle archive pages. Archive page are usually modular non-indexed page. Meaning they're just outputting a query from a user. The thing is on those types of self generated pages usually each crumb is unreliable (eg: If a user decide to click on the 2021, will it return a 404 error ?)... which is the case for custom post type/taxonomy for example.
Will do a bit of testing. Can you tell me what would be the expected breadcrumb output ? and behavior for each crumb in your case ?
hi @amarinediary, thanks for your response. I updated my questions a few minutes ago. Read the third part as well.
Will do a bit of testing. Can you tell me what would be the expected breadcrumb output ? and behavior for each crumb in your case ?
This code works well and is excellent. also Works well and on product pages as well as WooCommerce product listings. The only problems are the ones I mentioned above. If these cases are resolved, it is perfect.
In regards to the third point. Well, most of the time, website have a logo or some link redirecting to the home / front page... At that time I didn't needed a slug to point back to the home / front page, I will add an argument enabling the root crumb to be displayed in upcoming 1.0.5
excellent. Thank you for your time. I searched a lot on the internet but did not find anything complete. Undoubtedly, this will be the best example of BreadCrumb code.
The following will be deployed in 1.0.5
. View the changelog.
1.0.4
. (An idea on how to deal with multidimensional pages ? Open a new issue).
$ingredients
call root
to the_bread()
function.$ingredients['root']
, the root crumb. Default to null
.$ingredients['root']['slug']
, the root slug.$ingredient['root']['url']
, the root url.grate! thanks a lot
Hi, thank you very much for this repository.
(1) Unfortunately, the "Date Archive" pages are not displayed properly.
(2) If the page name has "dash", also The second part of the slug is deleted. For example, my page slug is "new-page" then in breadcrumbs only displayed "new"!
(3) And another Question: is not it better to use "Site Title" for "home" instead of Slug? Because it is possible to use breadcrumbs in other languages, in which case the use of slug is not appropriate at all. Please correct this as well.
Best regards