Forum Replies Created

Viewing 15 replies - 151 through 165 (of 2,399 total)
  • Plugin Author John Havlik

    (@mtekk)

    1.3.1 has been released and should fix this issue.

    Plugin Author John Havlik

    (@mtekk)

    If you using one of the list types for the markup (ul or ol) you will need to use CSS to make it display as a breadcrumb trail instead of a list.
    Something like the following should get the breadcrumbs appearing next to each other (note it assumes the wrapping tag has the class of breadcrumbs):

    .breadcrumbs li
    {
    	list-style: none;
    	margin: 0;
    }
    .breadcrumbs > li
    {
    	float: left;
    	padding-left: 10px;
    }

    The later portion of the following article is where I took this from, and has some more detail as to what the CSS is doing: https://mtekk.us/archives/guides/vista-like-breadcrumbs-for-wordpress/

    Plugin Author John Havlik

    (@mtekk)

    From the posted log, only the first message looks to actually be caused by Breadcrumb NavXT. The jsonSerialize() return type warning is a known issue and has been fixed in the development branch (see https://github.com/mtekk/Breadcrumb-NavXT/tree/triathlete) for the next release of Breadcrumb NavXT.

    Plugin Author John Havlik

    (@mtekk)

    So, adjusting the browser’s URL bar based on the attributes selected for the product is not something that is within the scope of breadcrumb trails or what Breadcrumb NavXT does. To update the browser’s URL bar you probably need some JavaScript that runs and adds components to the URL when each attribute is adjusted.

    Plugin Author John Havlik

    (@mtekk)

    Normally, you do not want two instances of a schema.org BreadcrumbList within a webpage as it’ll confuse search engines. So, you can have the JSON-LD markup and the visible trail, but you’d likely want to remove the schema.org markup from the visible trail.

    new bcn_breadcrumb creates a new bcn_breadcrumb object instantiation. You can review the class and its constructor here: https://github.com/mtekk/Breadcrumb-NavXT/blob/master/class.bcn_breadcrumb.php#L50 There is PHPDoc comments for every member function in that class.

    The parameters for the __construct function are the same that can be passed in when instantiating a new bcn_breadcrumb object. Take a look at the PHPDoc comment block before the constructor’s definition and let me know if you have any questions (some of the parameters are simple, others may be less obvious).

    array_splice is something I haven’t worked with in a while however the parameters are mostly straight forward. The first is the array you are going to modify/work with. The second is the offset at where you want to start within the array. This parameter has a second feature that using negative values indexes from the end of the array (-1 is the last element, -2 is the 2nd to last element, etc). The third parameters is the number of elements in the array to replace (use 0 if just inserting item(s) into the array). The last parameter is the “replacement”/items you are adding to the array (in our case it’s a bcn_breadcrumb instance).

    Plugin Author John Havlik

    (@mtekk)

    The first site you linked to doesn’t seem to have a breadcrumb trail showing up for me, so I’m not exactly sure what you’re trying to replicate. Assuming what you want to do is have product variations represented in the breadcrumb trail, that could get messy quickly. Breadcrumb NavXT generates location breadcrumb trails, which subscribes to the idea that resources have one true location. Thus, having the variation influence anything before the current item breadcrumb in the trail isn’t going to really fit the location breadcrumb model. Additionally, I’m not exactly sure adding the variations to the end of the trail makes a ton of sense either. Technically, either are possible to achieve, but you’re going to need custom code to pick off what variation is in effect and add that breadcrumb (though I’m not sure what it’d link to exactly, maybe an archive for all products of that variation type?).

    Plugin Author John Havlik

    (@mtekk)

    FYI, you need to wrap any HTML you try to post to the forums in `, otherwise odd things will happen.

    From what I can tell, the WCAG 2.1 only seems to require wrapping the whole thing in a nav element with the proper arria-label set to breadcrumbs (along with having a visible separator and the elements other than the current item linked). Example 3 uses unordered list (the most improper tag for a breadcrumb trail as there definitely is order in a breadcrumb trail), but I see no indication that is the required markup.

    You can call bcn_display_list() instead of bcn_display() to get each of the breadcrumbs wrapped in li elements and place the call within the list tags of your choice (ol or ul).

    • This reply was modified 3 years, 7 months ago by John Havlik.
    • This reply was modified 3 years, 7 months ago by John Havlik.
    Plugin Author John Havlik

    (@mtekk)

    Since root pages are not truly a part of WordPress core, translating them requires additional code which is not present in WPML nor Breadcrumb NavXT. You can do this by using the bcn_before_fill action to modify the root page settings just before the breadcrumb trail is generated. This said, there is a extension for Breadcrumb NavXT that adds WPML string translation support for root page translation (in addition to the rest of the Breadcrumb NavXT settings).

    Plugin Author John Havlik

    (@mtekk)

    To answer your most recent question, the way this is usually done is having a JSON-LD version of the breadcrumb trail in the header of the webpage. Yoast SEO provides an interface, and https://github.com/mtekk/Breadcrumb-NavXT-Schema hooks into it to use the Breadcrumb NavXT version of the breadcrumb trail instead of the Yoast SEO one. If you don’t want to use Yoast SEO, you can still use the Schema extension plugin as a reference (the call to bcn_display_json_ld is what you want to play with).

    I haven’t had a chance to review the code in your previous comment yet, hopefully I can take a look at it tomorrow.

    Plugin Author John Havlik

    (@mtekk)

    What are you expecting Cat or Tag to link to, or represent? I ask as WordPress doesn’t have a concept of a root page for all categories or tags. Thus, Breadcrumb NavXT doesn’t create breadcrumbs for them (thus no Cat or Tags breadcrumbs). Everything is post (of any post type) centric, posts are ‘things’ while taxonomies are just ways to classify things. So, post types will have archive pages, and root pages, but taxonomies will not as taxonomies are just a way to organize posts (of any post type). So, Breadcrumb NavXT treats posts (of any type) as the more important thing and associates taxonomies with the post type (a term archive will throw in the post type archive breadcrumb of the primary post type associated with the taxonomy).

    The expected behavior is Home > Term (category name, tag name) on a term archive page for non-static front page sites using the built-in Category and Tag taxonomies associated with the built-in Post post type. For a single post, the expected breadcrumb trail would be Home > Term > Post Name for a similarly configured site (note that the term breadcrumb may be several breadcrumbs if using a hierarchical taxonomy and the post is a member of a term with a parent term; that is the term breadcrumb will expand to represent a hierarchical term’s parent hierarchy, if present).

    As a side note, it appears someone else is trying to do a similar thing (see https://wordpress.org/support/topic/custom-taxonomy-missing-item/), I don’t really recommend trying to do this as you’re going to be fighting WordPress in how it tries to do things.

    Plugin Author John Havlik

    (@mtekk)

    As far as I am aware, WordPress doesn’t really have a concept of an archive page or root page for taxonomies. Typically, taxonomies end up getting associated with post types, which do have archive pages/root pages. Hence, Breadcrumb NavXT doesn’t add a breadcrumb in for the taxonomy name into the breadcrumb trail. Likewise, when you try to navigate to the /cars/ you get a 404 error message as WordPress doesn’t actually have any idea what to display there.

    That all said, you can add arbitrary breadcrumbs to the breadcrumb trail using the bcn_after_fill action (adding new instances of bcn_breadcrumb to the breadcrumbs array (member of the bcn_breadcrumb_trail object that is passed into the action)).

    As for making a root page for the taxonomy (make cars be something real/not a 404), in theory you could make a page called Cars. However, I think by default it causes permalink resolving issues with your taxonomy base slug. There may be a way around that with some custom permalink rules, but it’s been quite some time since I’ve messed with those so I, unfortunately, can’t give a definitive answer here.

    Plugin Author John Havlik

    (@mtekk)

    Not directly, but calling bcn_display(true, false) and passing the result into something that strips HTML tags such as strip_tags() will probably produce a trail that doesn’t contain HTML tags so it should work within the title tag. So, in theory something like the following may work:
    echo strip_tags(bcn_display(true, false));
    Note I have not tried this so it may need additional code/adjustment.

    Plugin Author John Havlik

    (@mtekk)

    This could be one of two things, either it’s a root page for the product post type, or it is a link to the archive for the product post type. The root page is controlled by the “Root Page” setting for the product post type. For the latter, the ‘Archive Display’ setting controls its inclusion.

    Plugin Author John Havlik

    (@mtekk)

    Regarding not showing a tag or category, you can uncheck the “Hierarchy Display” option for the post type in question.

    Looking at your site, it appears you have something configured in an odd manner. “Tags” is representing a the root page of your posts (you have the Tags page set as the Posts page within the WordPress settings under the reading screen). However, it appears you don’t have a static front page, and the Tags page just shows a tag cloud, which really isn’t properly fulfilling the role of the root page for posts/page for posts. So you probably don’t want to have a posts page set (and need to not have it set as your posts page to prevent Breadcrumb NavXT from adding it to the breadcrumb trail).

    Plugin Author John Havlik

    (@mtekk)

    My guess is that whatever post type Default is a member of, the selected hierarchy is tag instead of category (see the Breadcrumb NavXT settings for the post type in question).

Viewing 15 replies - 151 through 165 (of 2,399 total)