• Hi! If I choose to display in “Post Hierarchy” – tags, then I see all tags in breadcrumbs in the posts. Can I display only the first tag, not all post tags?

    I got this:

    Site.com > tag1, tag2, tag3 > Post Title

    But I want:

    Site > tag1 > Post Title

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

    (@mtekk)

    Using the bcn_post_terms filter, you can return just the first term (in an array). Something like the following should work:

    add_filter('bcn_post_terms','my_bcn_post_term_selector', 10, 3);
    function my_bcn_post_term_selector($terms, $taxonomy, $id)
    {
    	//Check to ensure the terms list is an array and there is more than one item in it
    	if(is_array($terms) && count($terms) > 1)
    	{
    		//Return the fist item in a new array
    		return array(0 => reset($terms));
    	}
    	return $terms;
    }

    This code was taken from an article on bcn_post_terms that scheduled for release on May 15th.

    • This reply was modified 6 years, 1 month ago by John Havlik.
Viewing 1 replies (of 1 total)

The topic ‘Breadcrumb NavXT Settings & Post Hierarchy’ is closed to new replies.