John Havlik
Forum Replies Created
-
Forum: Plugins
In reply to: [Breadcrumb NavXT] change text of specific page in the trailBy default Breadcrumb NavXT uses the post title of the root post type root page for that breadcrumb in the breadcrumb trail. The easiest thing to do is to change the actual title of the root page. If you want the two to be different for some reason, you can achieve this with the
bcn_breadcrumb_titlefilter. If you’re trying to change things for multi-lingual site reasons, there are premium extensions that will do this for you (may be a moot point at it looks like that route was taken on the linked site).Forum: Plugins
In reply to: [Breadcrumb NavXT] Removing the DAY from the breadcrumb date trailYou’ll need to use the
bcn_after_fillaction to remove the day breadcrumb from the trail when it is present. You should be able to loop through the members of thebreadcrumbsmember array in the passed inbcn_breadcrumb_trailobject. You’ll want to use thebcn_breadcrumb::get_types()function to get the types array and check for ‘date-day’.A skeleton of what to put into your action function:
foreach($breadcrumb_trail->breadcrumbs as $key => $breadcrumb) { if(in_array('date-day', $breadcrumb->get_types()) { //Code to remove breadcrumb here suggest using array_splice } }Forum: Plugins
In reply to: [Breadcrumb NavXT] No link to the breadcrumbIf you check the generated markup (the page’s HTML), Breadcrumb NavXT is generating links for the breadcrumbs in the trail. However, due to some other elements on the page and some goofy CSS the anchors in the breadcrumb trail do not get focus (and hence you can not click on them).
Forum: Plugins
In reply to: [Breadcrumb NavXT] Search form result in trailIf you are talking about when on the second page of search results (with showing the Paged breadcrumb setting enabled), you can accomplish this using the
bcn_after_fillaction and manually re-arrange the last two members of the breadcrumbs array. If you are talking about injecting another breadcrumb into the trail for search pages, that can be accomplished withbcn_after_fillas well.Forum: Plugins
In reply to: [Breadcrumb NavXT] itemprop=”itemListElement”The default settings for Breadcrumb NavXT are schema.org BreadcrumbList compliant, you shouldn’t need to modify them. That said, if you want to use
liwrappers, it is probably better to usebcn_display_listrather thanbcn_display.The reason the setting won’t save is likely due to something in the li element not being whitelisted when it is run through
wp_kses. You can add support for this element and various attributes by writing a filter for thebcn_allowed_htmlhook. See https://mtekk.us/archives/guides/how-to-add-li-and-other-tags-to-breadcrumb-templates/ for an example of how to do this.Forum: Plugins
In reply to: [Breadcrumb NavXT] Breadcrumbs won’t show trailIt looks like those items are pages, but there isn’t a page parent hierarchy setup. What I mean by that is it doesn’t appear “Emma Gad – Smaa Vink” is set as the parent page for “Små vink fra 1915”? Likewise, “Egne materialer” does not appear to be set as the parent page of “Emma Gad – Smaa Vink”. Breadcrumb NavXT isn’t going to be able to pick up on the the intended hierarchy without the page parent relationship being set (the WordPress menu does not dictate resource hierarchy/organization within WordPress).
Forum: Plugins
In reply to: [Breadcrumb NavXT] Replace site title with “Home”In the Breadcrumb NavXT settings page, under the General tab, look for the “Home Template” and “Home Template (unlinked)” settings. In these two settings replace instances of
%title%an%htitle%with Home. After you have completed making your changes, remember to press the “Save Changes” button at the bottom of the screen.Forum: Plugins
In reply to: [Breadcrumb NavXT] Breadcrumb root showing MyCMSInstalling a TLS certificate should not have caused this. Apparently, something is modifying what
get_option('blogname')returns (changing it to My CMS for some reason). To work around this you can replace instances of %title% and %htitle% in the Home breadcrumb templates (the regular and unlined ones) located under the General tab in the Breadcrumb NavXT settings page.Forum: Plugins
In reply to: [Breadcrumb NavXT] Still show “Home” when on Home pageNormally, you wouldn’t exclude the home breadcrumb on some pages but not others. While the option exists to not include the home breadcrumb, it really is in poor form to exclude the home breadcrumb.
The simplest way to accomplish what you are trying to do is to manually output the Home breadcrumb markup on the frontpage in lieu of the call to
bcn_display().An alternative way, which may be slightly more elegant, is to write a hook into the
bcn_after_filloption. Have this hook remove the home breadcrumb only when not on the front page (test for!is_front_page(), or just don’t remove anything if there is only one element in thebreadcrumbsarray in thebcn_breadcrumb_trailobject passed into your action). The home breadcrumb should be the last entry in thebcn_breadcrumb_trail::breadcrumbsarray passed into your action. Place this code in a site specific plugin, and make sure that you are not disabling the display of the home breadcrumb in the settings page (as you have code that is doing it selectively for you).Forum: Plugins
In reply to: [Breadcrumb NavXT] Bootstrap support?You’ll need to use something like the following for your calling code:
<?php if(function_exists('bcn_display_list')):?> <nav class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/" aria-label="breadcrumb"> <ol class="breadcrumb"> <?php bcn_display_list();?> </ol> </nav> <?php endif; ?>Additionally, you will need something like the following in a site specific plugin:
add_filter('bcn_display_attributes', my_display_attributes_filter, 10, 3); function my_display_attributes_filter($attribs, $types, $id) { $attribs .= ' class="breadcrumb-item'; //For the current item we need to add a little more info if(is_array($types) && in_array('current-item', $types)) { $attribs .= ' active" aria-current="page"'; } else { $attribs .= '"'; } }Note that I have not tested the above code yet (it’s taken from an article I’m writing on this subject). In theory it should work, but there may be the minor syntax error or logic goof on my part. Also, while looking into this, I’m not exactly thrilled with the
bcn_display_attributesfilter and I’m looking at improving that so it (or its replacement) is easier to use for Breadcrumb NavXT 6.3.0.- This reply was modified 7 years, 7 months ago by John Havlik.
Forum: Plugins
In reply to: [Breadcrumb NavXT] I don’t get itTraditionally, custom taxonomies are associated with a specific primary post type. Breadcrumb NavXT will pick the first post type associated except for when disabling archive display for that post type (will prevent inclusion of the CPT archive breadcrumb). Since WordPress does not have a concept of an archive for all post types, something like “My Site > Types > Viewpoints” is not something that necessarily makes sense (unless you create a multidimensional breadcrumb trail and include all the relevant CPTs in the 2nd dimension for “Types”, an interesting idea but not in the purview of the core plugin).
Currently, the easiest way to remove the CPT archive from the taxonomy archives is to ensure the “Archive Display” for the CPT in question is disabled in the Breadcrumb NavXT settings.
Forum: Plugins
In reply to: [Breadcrumb NavXT] Suggested configuration for Qode Bridge templateEvery time I set up a website featuring a Qode Bridge template, I install Breadcrumb Navxt. But I hate its settings.
Can you elaborate on what settings in Breadcrumb NavXT you do not like, and any suggestions you have for improving them? If you find yourself repeatedly changing a particular setting in Breadcrumb NavXT on the sites you use it on, you may find the settings import/export/reset form under the help dropdown menu useful.
Forum: Plugins
In reply to: [Breadcrumb NavXT] Move breadcrumbs After TitleThe best way to do this is really moving where the calling code is located in your theme so that it will output the breadcrumb trail markup in the proper location. Otherwise, you can reposition it with CSS (using absolute positioning, or some sort of relative-absolute positioning) but you’ll likely run into undesired/unexpected results (I do not recommend trying this unless you are very comfortable with CSS and dealing with various browser quirks).
Forum: Plugins
In reply to: [Breadcrumb NavXT] BreadcrumbList missing item in structured-data toolsThis is due to the lack of a link on the last breadcrumb in the trail. There are two solutions. Either enable linking the current item (under the General tab in the Breadcrumb NavXT settings page), or change the unlinked breadcrumb templates from:
<span property="itemListElement" typeof="ListItem"><span property="name">%htitle%</span><meta property="position" content="%position%"></span>to<span class="%type%">%htitle%</span>Forum: Plugins
In reply to: [Breadcrumb NavXT] Schema for each element in breadcrumb listI would try to educate the customer as it is not known how much longer Google will support the old Breacrumb syntax. It may help to show them all of Google’s examples now use BreadcrumbList (see https://developers.google.com/search/docs/data-types/breadcrumb). But, if that doesn’t work or isn’t worth the effort, you will need to change the breadcrumb templates so that they are something like:
<span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" title="%title%" href="%link%" class="home">%htitle%</a></span>Also, you will want to remove the
typeof="BreadcrumbList" vocab="https://schema.org/"from the wrapping div as leaving that there while using the Breadcrumb syntax will likely annoy/confuse the Google parser.