Yoast SEO
[Plugin: WordPress SEO by Yoast] Tiny feature request with code to implement - breadcrumb category p (1 post)

  1. thomask
    Posted 3 years ago #

    it is again regarding my problem that i cannot set, which categories will be shown in breadcrumb (http://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-breadcrumb-category-precedence?replies=1)

    i have one tiny change for you of class-breadcrumbs.php which would solve it:
    row 174, change

    $terms = wp_get_object_terms( $post->ID, $main_tax );


    $terms = wp_get_object_terms( $post->ID, $main_tax, array('orderby' => 'term_order') );

    I guess that default "by name" ordering is meaningless for practicaly everyone.
    Or if you want to make it even better - put there some filter, so users could define their own wp_get_object_terms args property, so something like

    $terms_args = apply_filters('yoast_terms_args', array());
    $terms = wp_get_object_terms( $post->ID, $main_tax, $terms_args);

    so we could filter it as we want


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic