amarinediary / WordPress-simple-URL-based-breadcrumb

🍞 A non-invasive WordPress unofficial plugin, minimalist and SEO friendly. both lightweight and lightning fast, adding URL based breadcrumb support. Plug-and-play, with no required configuration.
https://stackoverflow.com/a/67453887/3645650
Creative Commons Zero v1.0 Universal
27 stars 5 forks source link

Date Archive and Some pages #3

Closed hanyseyedy closed 2 years ago

hanyseyedy commented 2 years ago

Hi, thank you very much for this repository.

(1) Unfortunately, the "Date Archive" pages are not displayed properly.

breadcrumbs

(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"!

breadcrumbs2

(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

amarinediary commented 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 ?

hanyseyedy commented 2 years ago

hi @amarinediary, thanks for your response. I updated my questions a few minutes ago. Read the third part as well.

hanyseyedy commented 2 years ago

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.

amarinediary commented 2 years ago

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

hanyseyedy commented 2 years ago

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.

amarinediary commented 2 years ago

The following will be deployed in 1.0.5. View the changelog.

In response to (1):

hanyseyedy commented 2 years ago

grate! thanks a lot