• Resolved obokmaobao

    (@obokmaobao)


    Hello,

    I’m having some issues with the breadcrumbs display with CPT and Custom Taxonomy.

    Some of my posts have the correct breadcrumbs:
    Home >> Products >> Bags>> Sling Bags >> Post (I want this)

    While other posts have an incomplete breadcrumbs:
    Home >> Products >> Bags >> Post

    I’m currently using the shortcode [slim_seo_breadcrumbs taxonomy=”prod-cat”] which has already specified the taxonomy I want in the breadcrumbs. Is there anyway to make them consistently display both parent terms and child terms?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter obokmaobao

    (@obokmaobao)

    CPT: Wares
    Taxonomy: Wares Category

    I have managed to replicate the bug, and found out how it happens…
    the breadcrumb does not show child terms if the child term is alphabetically greater than the parent term.

    This “correct” breadcrumb will not show because Pins is alphabetically greater than Lifestyle :
    Home >> Wares >> Lifestyle >> Pins >> Post
    Published post result:
    Home >> Wares >> Lifestyle >> Post

    This breadcrumb will show correctly because Cushions is alphabetically lesser than Lifestyle:
    Home >> Wares >> Lifestyle >> Cushions >> Post

    Is there anyway this can be fixed?

    • This reply was modified 2 years, 11 months ago by obokmaobao.
    • This reply was modified 2 years, 11 months ago by obokmaobao.
    Plugin Author Anh Tran

    (@rilwis)

    Hi @obokmaobao,

    I understand the problem. If some terms are assigned to a post, Slim SEO only takes the first term to build the breadcrumbs. By default WordPress returns list of terms with alphabetical order, and causes the issue above.

    A quick fix for that is: when you set terms for a post, DON’T set the parent terms. Only set the child terms. WordPress is smart enough to always return the post if you view the parent term page.

    For example, if you have Livestyle > Pins, then only assign Pins to post. No need to assign Lifestyle.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Inconsistent CPT Breadcrumbs and Taxonomy’ is closed to new replies.