🍞 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.
Sometimes url_to_postid cannot retrieve the title of the page despite the page's existence, it happened for me in the archive page. It can also try to get the title using the slug if couldn't find it via the URL.
So I added this code:
Thank you for your input @mohamadnr.
Indeed it seems logic to have a fallback. I wasn’t aware that url_to_postid was failing from time to time. I will update the original file as soon as I can.
Sometimes
url_to_postid
cannot retrieve the title of the page despite the page's existence, it happened for me in the archive page. It can also try to get the title using the slug if couldn't find it via the URL. So I added this code:and changed the value inside the
span
to this:Seems better to me.