Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #354142

    How can we set breadcrumbs using assigned categories for custom post types?

    any help is greatly appreciated!

    #354388

    Hey pixallus!

    Are you trying to get the custom post type category to display in the breadcrumbs? If so then try this out, https://kriesi.at/support/topic/breadcrumbs-with-custom-post_types/.

    Cheers!
    Elliott

    #358896

    Yes, trying to get category to show in breadcrumb for CPTs.
    Tried both options from your linked thread, but no luck :(

    #359622

    Hi!

    Send us a WordPress login and set your reply as private and we’ll take a look.

    Best regards,
    Elliott

    #359869
    This reply has been marked as private.
    #359965

    Hi!

    Try opening up /enfold/framework/php/class-breadcrumbs.php and around line 306 you should see this.

    if($post_type == 'portfolio')
    {
    	$parents = get_the_term_list( $post_id, 'portfolio_entries', '', '$$$', '' );
    	$parents = explode('$$$',$parents);
    	foreach ($parents as $parent_item)
    	{
    		if($parent_item) $trail[] = $parent_item;
    	}
    }

    Try adding this beneath it.

    if($post_type == 'article')
    {
    	$parents = get_the_term_list( $post_id, 'article_taxonomy', '', '$$$', '' );
    	$parents = explode('$$$',$parents);
    	foreach ($parents as $parent_item)
    	{
    		if($parent_item) $trail[] = $parent_item;
    	}
    }

    And change “article_taxonomy” with whatever taxonomy you created.

    Best regards,
    Elliott

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.