Support » Plugin: Breadcrumb NavXT » Additional span tags being added to Custom Post Type category post

  • Hi

    I have a custom post type that has categories. For some reason when you go into a post within one of those categories, NavXT is adding span tags around the category name even though I have set up something different in the admin. For example

    My breadcrumb should look like this:

    <ul aria-label="breadcrumb" role="navigation">
    <!-- Breadcrumb NavXT 5.7.1 -->
    <li><a property="item" typeof="WebPage" title="Home" href="https://www.sitelink.com">home</a></li>
    <li><a property="item" typeof="WebPage" title="Post Type" href="https://www.sitelink.com/post-type">Post type</a></li>
    <li><a property="item" typeof="WebPage" title="Category" href="https://www.sitelink.com/post-type/category">Category</a></li>   
    <li>Item</li>          
    </ul>

    whereas it actually looks like this:

    <ul aria-label="breadcrumb" role="navigation">
    <!-- Breadcrumb NavXT 5.7.1 -->
    <li><a property="item" typeof="WebPage" title="Home" href="https://www.sitelink.com">home</a></li>
    <li><a property="item" typeof="WebPage" title="Post Type" href="https://www.sitelink.com/post-type">Post type</a></li>
    
    <span property="itemListElement" typeof="ListItem">
    <span property="name">
    <li><a property="item" typeof="WebPage" title="Category" href="https://www.sitelink.com/post-type/category">Category</a></li>   
    </span>
    <meta property="position" content="3">
    </span>
    
    <li>Item</li>                
    </ul>

    Note the span tags around the category.

    Any ideas how to remove the span tags which don’t exist in the admin at all??:/

    Many thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Havlik

    (@mtekk)

    This appears to be a bug in the way non-hierarchical taxonomy terms are handled. I’m tracking it with the following issue on GitHub: https://github.com/mtekk/Breadcrumb-NavXT/issues/169

    For the time being you have two choices:

    1. Use bcn_display_list() in conjunction with the default settings instead of bcn_display() if you want breadcrumbs wrapped in li elements.
    2. Change ‘Category’ to be a hierarchical taxonomy type.

    Good morning John,
    I followed your suggestions, using bcn_display_list() and also converting my custom taxonomy to “hierarchical”. Problem is NOT solved, unfortunately.

    Any news about the bug fix?

    Thanks

    Hi there.
    The only solution (a temporary and not perfect one) I found is using bcn_display_json_ld(true)
    and building my breadcrumbs parsing the result as array.

    Plugin Author John Havlik

    (@mtekk)

    Good morning John,
    I followed your suggestions, using bcn_display_list() and also converting my custom taxonomy to “hierarchical”. Problem is NOT solved, unfortunately.

    Any news about the bug fix?

    Thanks

    If my suggestion did not fix the issue, then there is something else going on here (possibly a misunderstanding/miscommunication). Using a hierarchcial taxonomy type should not have exhibited this problem. The cause of the multiple nested tag mess with non-hierarchical taxonomy terms has been fixed in the development branch in git. But, I have not closed the issue since I plan on refactoring that function a little to end up with a more elegant solution.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Additional span tags being added to Custom Post Type category post’ is closed to new replies.