John Havlik
Forum Replies Created
-
Forum: Plugins
In reply to: [Breadcrumb NavXT] Custom breadcrumb for Dynamic elementor pagesIf you want a specific hierarchy, it’s recommended to organize your content within WordPress such that said hierarchy is present (otherwise you’re just creating more work for yourself). Breadcrumb NavXT does not use the URL structure to determine what the breadcrumb trail should be, it uses the relationships between posts, their parents (if present), and the terms (of whatever taxonomy) they are members of. If said relationships are not established, you aren’t going to get the breadcrumb trail you expect.
For example, if the breadcrumb trail ends up being Home > Citypages and you want it to be Home > Services > Web Design > Citypages, if these are all of the page post type, then Citypages must be a child of Web Design which must be a child of Services (that is Citypages needs to have Web Design set as its parent page, and Web Design needs to have Services set as its parent page). Note that using pages isn’t the only way to make this hierarchy relationship work (there are ways of doing this with Custom Post Types with custom taxonomies as well).
Under certain circumstances, manually adding breadcrumbs to the breadcrumb trail is necessary (unlikely in this situation, usually necessary for adding support for 3rd party plugins that expand past the normal scope of what WordPress does with post and term/taxonomy relationships), and there are examples of how to do this in the documentation for the
bcn_after_fillaction.Forum: Plugins
In reply to: [Breadcrumb NavXT] Breadcumb Trail showing incorrectlyIt looks like your product is a member of multiple product category hierarchies. While WordPress supports this, it does not provide a method of determining what category is the most important one/most correct one to show when a post (of any post type) is a member of multiple terms within the same taxonomy. There are ways of influencing the category/term Breadcrumb NavXT uses. You can either write your own hook into the
bcn_pick_post_termfilter (have the filter return the term you want to use), use Order Bender (an example of how to use thebcn_pick_post_termfilter), or Breadcrumb NavXT Paths (especially if you want the user’s path to visiting a post influence the breadcrumb trail displayed).The code probably tries to access something that doesn’t exist. That is, your breadcrumbs array may not have any members, or only a single member (which would result in the -2 in the calculation for the key try to access something that doesn’t exist). You probably should check that there are more than 2 members in the breadcrumbs array before running that bit of code.
Also note,
bcn_after_fillis an action not a filter so the hook registration isn’t correct there (it’ll work but isn’t technically correct).Forum: Plugins
In reply to: [Breadcrumb NavXT] WPML extension?The WPML extensions plugin for Breadcrumb NavXT is a premium plugin available on the Breadcrumb NavXT author’s website. Items such as post titles and terms should translate without the extension. However, root pages, and the breadcrumb templates require the extension plugin to show up in the string translation area in WPML.
In the Breadcrumb NavXT settings page, replace
%htitle%and%title%in the home template with the text you want to display in the breadcrumb for the home page and press the “Save Changes” button.Forum: Plugins
In reply to: [NSFW] [Breadcrumb NavXT] Changing the Breadcrumb MenuIf you want the home link to always link to the “Member Page” (for every area it’d appear, including in the breadcrumb trail) you’d get
get_home_url()to output the link to the “Member Page”. Otherwise, if you want this to be just in the breadcrumb trail, you can use thebcn_breadcrumb_urlfilter to swap out the URL (either by matching the home URL, or looking for ‘home’ in the type array that is passed into the filter).Forum: Plugins
In reply to: [Breadcrumb NavXT] Bug if you disable category for postWhile I’d content having the first member of the
object_typearray within the taxonomy object be empty violates the API, I’ve made some changes to check for the existence before trying to use. This was tracked in the following github issue: https://github.com/mtekk/Breadcrumb-NavXT/issues/290Forum: Plugins
In reply to: [Breadcrumb NavXT] Google search console problemOn the homepage, you don’t have a breadcrumb trail (which is normal) so I wouldn’t expect to see a BreadcrumbList element there. As for the other pages, how are you calling the breadcrumb trail? The wrapping code isn’t correct (you are using an
olwrapping element with elements that arespannotli, unless you really want to useolandlielements I recommend wrapping the call in adiv). The recommended calling code is:<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/"> <?php if(function_exists('bcn_display')) { bcn_display(); }?> </div>That should cause the breadcrumb trail to show up as a BreadcrumbList item in the rich results test.
Forum: Plugins
In reply to: [Breadcrumb NavXT] Validator problemsBreadcrumb NavXT doesn’t by default output the breadcrumb trail twice, my guess is the original call to
bcn_display()was still there somewhere. It looks like on the page you linked to earlier that there is just one breadcrumb trail, and that the validator seems to find the BreadcrumbList element, are you still having this issue?Forum: Plugins
In reply to: [Breadcrumb NavXT] Validator problemsHow is the site calling the breadcrumb trail? The site in question seems to be using a wrapping
divelement that is missing the schema vocab and typeof attributes (it looks like it is using an old recommendation for the Breadcrumb NavXT calling code). The recommended calling code is:<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/"> <?php if(function_exists('bcn_display')) { bcn_display(); }?> </div>That will get the schema.org markup to be recognized. If you are using the widget, you probably should select the “Output Trail as” value of “Schema.org BreadcrumbList (RDFa)”.
Forum: Plugins
In reply to: [Breadcrumb NavXT] Google search console problemIf you look at what the search console is complaining about, it appears to be on a JSON-LD breadcrumb, which appears to be part of a block that Rank Math is creating (my guess is this is not Breadcrumb NavXT that is causing the issue). If Rank Math is trying to pull in the JSON-LD output of Breadcrumb NavXT, there is likely some extra stuff that needs to be done (see https://github.com/mtekk/Breadcrumb-NavXT-Schema/blob/master/class-schema-breadcrumb-navxt.php). Namely, if you are going to have the
itemsubfield be an array, you must specify a type (specifically"@type":"WebPage"). Of course, this isn’t in the schema.org examples, but both the schema.org validator and the Google validator seem to want this.Forum: Plugins
In reply to: [Breadcrumb NavXT] Google search console problemWithout seeing the “more information” part of the google search console error, it’s difficult to diagnose what is going on. Also, seeing the markup Breadcrumb NavXT is generating would help diagnose the issue.
Forum: Plugins
In reply to: [Breadcrumb NavXT] How to display a minimal version of breadcrumbs on mobile?There should be a way of accomplishing this using CSS (which is a better way than generating different content for mobile vs desktop). There is a way to target the nth element in a structure, which should allow you to target the second-to-last item in the trail to display (and can modify the text/prepend text to the text). I’ll look at this a little more and see if I can come up with a CSS demo.
Forum: Plugins
In reply to: [Breadcrumb NavXT] Multilang and mainpageSo the link to the home/main page is retrieved using the WordPress API function
get_home_url(). If that isn’t returning the correct URL for the language, then you’ll need extra code to get the correct URL there. This will depend on what you are using for facilitating the multi-language setup on your site. Both WPML and Polylang no longer auto translateget_home_url()so it requires extra code which either you can write yourself or you can use the Breadcrumb NavXT extension plugins for said multi-language plugins.Forum: Plugins
In reply to: [Breadcrumb NavXT] Plugin updateThe current version (Breadcrumb NavXT 7.2) works fine with WordPress 6.3, updated the readme to match.