Breadcrumbs for Custom Post Type

Hi,

I have a custom post type and would like to get breadcrumbs going. Is there a code block or something I can modify? I read a previous post on modifying breadcrumbs.js, couldn’t make sense of it in terms of my CPT. Just need to know what I need to change.

Thanks!

I have a similar issue.

I just noticed that my article is not nested under my blog URL: klineadventures.com/blog/
Instead, I see that it is not nested: https://klineadventures.com/gulmarg-gondola-claims-7-lives/
It should be nested as such: https://klineadventures.com/blog/gulmarg-gondola-claims-7-lives/
Can this be corrected, if so how?

Thanks in advance!!

Hi @becktowery,

Add the following on your child theme functions.php file and then add your custom breadcrumbs:

// Breadcrumbs
// =============================================================================

if ( ! function_exists( 'x_breadcrumbs' ) ) :
  function x_breadcrumbs() {

    if ( x_get_option( 'x_breadcrumb_display' ) ) {

      GLOBAL $post;

      $is_ltr         = ! is_rtl();
      $stack          = x_get_stack();
      $delimiter      = x_get_breadcrumb_delimiter();
      $home_text      = x_get_breadcrumb_home_text();
      $home_link      = home_url();
      $current_before = x_get_breadcrumb_current_before();
      $current_after  = x_get_breadcrumb_current_after();
      $page_title     = get_the_title();
      $blog_title     = get_the_title( get_option( 'page_for_posts', true ) );

      if ( ! is_404() ) {
      $post_parent = $post->post_parent;
      } else {
      $post_parent = '';
      }

      if ( X_WOOCOMMERCE_IS_ACTIVE ) {
      $shop_url   = x_get_shop_link();
      $shop_title = x_get_option( 'x_' . $stack . '_shop_title' );
      $shop_link  = '<a href="'. $shop_url .'">' . $shop_title . '</a>';
      }

      echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;

      if ( is_home() ) {

        echo $current_before . $blog_title . $current_after;

      } elseif ( is_category() ) {

        $the_cat = get_category( get_query_var( 'cat' ), false );
        if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter );
        echo $current_before . single_cat_title( '', false ) . $current_after;

      } elseif ( x_is_product_category() ) {

        if ( $is_ltr ) {
        echo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after;
        } else {
        echo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link;
        }

      } elseif ( x_is_product_tag() ) {

        if ( $is_ltr ) {
        echo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after;
        } else {
        echo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link;
        }

      } elseif ( is_search() ) {

        echo $current_before . __( 'Search Results for ', '__x__' ) . '&#8220;' . get_search_query() . '&#8221;' . $current_after;

      } elseif ( is_singular( 'post' ) ) {

        if ( get_option( 'page_for_posts' ) == is_front_page() ) {
        echo $current_before . $page_title . $current_after;
        } else {
        if ( $is_ltr ) {
          echo '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
        } else {
          echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>';
        }
        }

      }  elseif ( is_singular( 'your_post_type' ) ) {

        if ( $is_ltr ) {
          echo '<a href="' . get_permalink( 7372 ) . '">' . __( 'Your post type' ) . '</a>' . $delimiter . $current_before . $page_title . $current_after;
        } else {
          echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . get_permalink( 7372 ) . '">' . __( 'Your post type' ) . '</a>';
        }

      } elseif ( x_is_portfolio() ) {

        echo $current_before . get_the_title() . $current_after;

      } elseif ( x_is_portfolio_item() ) {

        $link  = x_get_parent_portfolio_link();
        $title = x_get_parent_portfolio_title();

        if ( $is_ltr ) {
        echo '<a href="' . $link . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
        } else {
        echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . $link . '">' . $title . '</a>';
        }

      } elseif ( x_is_product() ) {

        if ( $is_ltr ) {
        echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
        } else {
        echo $current_before . $page_title . $current_after . $delimiter . $shop_link;
        }

      } elseif ( x_is_buddypress() ) {

        if ( bp_is_group() ) {
        echo '<a href="' . bp_get_groups_directory_permalink() . '">' . x_get_option( 'x_buddypress_groups_title' ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;
        } elseif ( bp_is_user() ) {
        echo '<a href="' . bp_get_members_directory_permalink() . '">' . x_get_option( 'x_buddypress_members_title' ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;
        } else {
        echo $current_before . x_buddypress_get_the_title() . $current_after;
        }

      } elseif ( x_is_bbpress() ) {

        remove_filter( 'bbp_no_breadcrumb', '__return_true' );

        if ( bbp_is_forum_archive() ) {
        echo $current_before . bbp_get_forum_archive_title() . $current_after;
        } else {
        echo bbp_get_breadcrumb();
        }

        add_filter( 'bbp_no_breadcrumb', '__return_true' );

      } elseif ( is_page() && ! $post_parent ) {

        echo $current_before . $page_title . $current_after;

      } elseif ( is_page() && $post_parent ) {

        $parent_id   = $post_parent;
        $breadcrumbs = array();

        if ( is_rtl() ) {
        echo $current_before . $page_title . $current_after . $delimiter;
        }

        while ( $parent_id ) {
        $page          = get_page( $parent_id );
        $breadcrumbs[] = '<a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a>';
        $parent_id     = $page->post_parent;
        }

        if ( $is_ltr ) {
        $breadcrumbs = array_reverse( $breadcrumbs );
        }

        for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) {
        echo $breadcrumbs[$i];
        if ( $i != count( $breadcrumbs ) -1 ) echo $delimiter;
        }

        if ( $is_ltr ) {
        echo $delimiter . $current_before . $page_title . $current_after;
        }

      } elseif ( is_tag() ) {

        echo $current_before . single_tag_title( '', false ) . $current_after;

      } elseif ( is_author() ) {

        GLOBAL $author;
        $userdata = get_userdata( $author );
        echo $current_before . __( 'Posts by ', '__x__' ) . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';

      } elseif ( is_404() ) {

        echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after;

      } elseif ( is_archive() ) {

        if ( x_is_shop() ) {
        echo $current_before . $shop_title . $current_after;
        } else {
        echo $current_before . __( 'Archives ', '__x__' ) . $current_after;
        }

      }

      echo '</div>';

    }

  }
endif;

I added this code that you can change:

elseif ( is_singular( 'your_post_type' ) ) {
  if ( $is_ltr ) {
    echo '<a href="' . get_permalink( 7372 ) . '">' . __( 'Your post type' ) . '</a>' . $delimiter . $current_before . $page_title . $current_after;
  } else {
    echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . get_permalink( 7372 ) . '">' . __( 'Your post type' ) . '</a>';
  }
}

Please change the post type and its labels, and change the ID of 7372. It’s the ID of your custom post type’s home page.

Hi @paullalley,

Upon checking, this post: https://klineadventures.com/gulmarg-gondola-claims-7-lives/ is a normal blog post and not a custom post type. So it’s a different case for you. It will only add BLOG on the breadcrumbs if we set the blog page:https://klineadventures.com/blog/ as your post page on Settings > Reading. Currently, your blog page is just a normal page because you are using the grid. Unfortunately, this is the downside of using this setup. BLOG page will only be added on the breadcrumb if it’s set as normal post page.

Thanks, I was testing this a while back and also came across this. Unfortunately, the standard blog page is not desirable. (1.) Will there be any updates to Pro soon to address this issue? (2) is there a workaround to achieve this?

Thanks so much! Just what I need. This works in my plug in script too. One thing though…is there a way to refer to the page we just left instead of the CPT home page? instead of the 7372? This is a branching system based on girds and categories that has no specific page for the CPT.

Hi @paullalley,

  1. Not yet but I can add this as feature request so this can be taken into consideration. All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive.
  2. A workaround is to add the actual blog page on the breadcrumb functions manually. Add this code on your child theme functions.php file:
// Breadcrumbs
// =============================================================================

if ( ! function_exists( 'x_breadcrumbs' ) ) :
  function x_breadcrumbs() {

    if ( x_get_option( 'x_breadcrumb_display' ) ) {

      GLOBAL $post;

      $is_ltr         = ! is_rtl();
      $stack          = x_get_stack();
      $delimiter      = x_get_breadcrumb_delimiter();
      $home_text      = x_get_breadcrumb_home_text();
      $home_link      = home_url();
      $current_before = x_get_breadcrumb_current_before();
      $current_after  = x_get_breadcrumb_current_after();
      $page_title     = get_the_title();
      $blog_title     = get_the_title( get_option( 'page_for_posts', true ) );

      if ( ! is_404() ) {
        $post_parent = $post->post_parent;
      } else {
        $post_parent = '';
      }

      if ( X_WOOCOMMERCE_IS_ACTIVE ) {
        $shop_url   = x_get_shop_link();
        $shop_title = x_get_option( 'x_' . $stack . '_shop_title' );
        $shop_link  = '<a href="'. $shop_url .'">' . $shop_title . '</a>';
      }

      echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;

        if ( is_home() ) {

          echo $current_before . $blog_title . $current_after;

        } elseif ( is_category() ) {

          $the_cat = get_category( get_query_var( 'cat' ), false );
          if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter );
          echo $current_before . single_cat_title( '', false ) . $current_after;

        } elseif ( x_is_product_category() ) {

          if ( $is_ltr ) {
            echo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after;
          } else {
            echo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link;
          }

        } elseif ( x_is_product_tag() ) {

          if ( $is_ltr ) {
            echo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after;
          } else {
            echo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link;
          }

        } elseif ( is_search() ) {

          echo $current_before . __( 'Search Results for ', '__x__' ) . '&#8220;' . get_search_query() . '&#8221;' . $current_after;

        } elseif ( is_singular( 'post' ) ) {

          if ( get_option( 'page_for_posts' ) == is_front_page() ) {
            echo $current_before . $page_title . $current_after;
          } else {
            if ( $is_ltr ) {
              echo '<a href="https://klineadventures.com/blog/"> BLOG </a>' . $delimiter . $current_before . $page_title . $current_after;
            } else {
              echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>';
            }
          }

        } elseif ( x_is_portfolio() ) {

          echo $current_before . get_the_title() . $current_after;

        } elseif ( x_is_portfolio_item() ) {

          $link  = x_get_parent_portfolio_link();
          $title = x_get_parent_portfolio_title();

          if ( $is_ltr ) {
            echo '<a href="' . $link . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
          } else {
            echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . $link . '">' . $title . '</a>';
          }

        } elseif ( x_is_product() ) {

          if ( $is_ltr ) {
            echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
          } else {
            echo $current_before . $page_title . $current_after . $delimiter . $shop_link;
          }

        } elseif ( x_is_buddypress() ) {

          if ( bp_is_group() ) {
            echo '<a href="' . bp_get_groups_directory_permalink() . '">' . x_get_option( 'x_buddypress_groups_title' ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;
          } elseif ( bp_is_user() ) {
            echo '<a href="' . bp_get_members_directory_permalink() . '">' . x_get_option( 'x_buddypress_members_title' ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;
          } else {
            echo $current_before . x_buddypress_get_the_title() . $current_after;
          }

        } elseif ( x_is_bbpress() ) {

          remove_filter( 'bbp_no_breadcrumb', '__return_true' );

          if ( bbp_is_forum_archive() ) {
            echo $current_before . bbp_get_forum_archive_title() . $current_after;
          } else {
            echo bbp_get_breadcrumb();
          }

          add_filter( 'bbp_no_breadcrumb', '__return_true' );

        } elseif ( is_page() && ! $post_parent ) {

          echo $current_before . $page_title . $current_after;

        } elseif ( is_page() && $post_parent ) {

          $parent_id   = $post_parent;
          $breadcrumbs = array();

          if ( is_rtl() ) {
            echo $current_before . $page_title . $current_after . $delimiter;
          }

          while ( $parent_id ) {
            $page          = get_page( $parent_id );
            $breadcrumbs[] = '<a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a>';
            $parent_id     = $page->post_parent;
          }

          if ( $is_ltr ) {
            $breadcrumbs = array_reverse( $breadcrumbs );
          }

          for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) {
            echo $breadcrumbs[$i];
            if ( $i != count( $breadcrumbs ) -1 ) echo $delimiter;
          }

          if ( $is_ltr ) {
            echo $delimiter . $current_before . $page_title . $current_after;
          }

        } elseif ( is_tag() ) {

          echo $current_before . single_tag_title( '', false ) . $current_after;

        } elseif ( is_author() ) {

          GLOBAL $author;
          $userdata = get_userdata( $author );
          echo $current_before . __( 'Posts by ', '__x__' ) . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';

        } elseif ( is_404() ) {

          echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after;

        } elseif ( is_archive() ) {

          if ( x_is_shop() ) {
            echo $current_before . $shop_title . $current_after;
          } else {
            echo $current_before . __( 'Archives ', '__x__' ) . $current_after;
          }

        }

      echo '</div>';

    }

  }
endif;

You can see that I have updated this part under the single post filter:

echo '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;

To this:

echo '<a href="https://klineadventures.com/blog/"> BLOG </a>' . $delimiter . $current_before . $page_title . $current_after;

@becktowery, Instead of page ID we can use the page slug.

Hope this helps.

I have added the code to the child theme functions.php with no result. you can see it not in effect here https://klineadventures.com/taking-shredding-to-a-new-level-in-the-himalayas/ can you take a look?

Paul.

Hi,

Would you mind providing us with login credentials so we can take a closer look? Please provide following information:

Set it as Secure Note

  • Link to your site
  • WordPress Admin username / password
  • FTP credentials

All the best!

HI,
Ok so Ive this working as is. Only problem is the CPT we are using this on is two slots out from the parent page, not just one.
Should be:
Home | Projects page | Category page | Custom Post page

This is giving me:
Home | Projects page | Custom Post page

How can we get that extra step in there?

Thanks!

Hi @paullalley,

The original poster of this thread is someone else. In order to give us your Wordpress Credentials, you need to open up a thread yourself and use the Secure Note functionality.

Kindly describe the issue in details in the new post to follow up the case.

Thank you.

Hi @becktowery,

Please update the code to:


// Breadcrumbs
// =============================================================================

if ( ! function_exists( 'x_breadcrumbs' ) ) :
  function x_breadcrumbs() {

    if ( x_get_option( 'x_breadcrumb_display' ) ) {

      GLOBAL $post;

      $is_ltr         = ! is_rtl();
      $stack          = x_get_stack();
      $delimiter      = x_get_breadcrumb_delimiter();
      $home_text      = x_get_breadcrumb_home_text();
      $home_link      = home_url();
      $current_before = x_get_breadcrumb_current_before();
      $current_after  = x_get_breadcrumb_current_after();
      $page_title     = get_the_title();
      $blog_title     = get_the_title( get_option( 'page_for_posts', true ) );

      if ( ! is_404() ) {
      $post_parent = $post->post_parent;
      } else {
      $post_parent = '';
      }

      if ( X_WOOCOMMERCE_IS_ACTIVE ) {
      $shop_url   = x_get_shop_link();
      $shop_title = x_get_option( 'x_' . $stack . '_shop_title' );
      $shop_link  = '<a href="'. $shop_url .'">' . $shop_title . '</a>';
      }

      echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;

      if ( is_home() ) {

        echo $current_before . $blog_title . $current_after;

      } elseif ( is_category() ) {

        $the_cat = get_category( get_query_var( 'cat' ), false );
        if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter );
        echo $current_before . single_cat_title( '', false ) . $current_after;

      } elseif ( x_is_product_category() ) {

        if ( $is_ltr ) {
        echo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after;
        } else {
        echo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link;
        }

      } elseif ( x_is_product_tag() ) {

        if ( $is_ltr ) {
        echo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after;
        } else {
        echo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link;
        }

      } elseif ( is_search() ) {

        echo $current_before . __( 'Search Results for ', '__x__' ) . '&#8220;' . get_search_query() . '&#8221;' . $current_after;

      } elseif ( is_singular( 'post' ) ) {

        if ( get_option( 'page_for_posts' ) == is_front_page() ) {
        echo $current_before . $page_title . $current_after;
        } else {
        if ( $is_ltr ) {
          echo '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
        } else {
          echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>';
        }
        }

      }  elseif ( is_singular( 'your_post_type' ) ) {

        if ( $is_ltr ) {

          $customcategory = get_the_terms( $post->ID, 'Your post type' );     
          foreach ( $customcategory as $cat){
             $thecat = $cat->name;
          }

          echo '<a href="' . get_permalink( 7372 ) . '">' . __( 'Your post type' ) . '</a>' . $delimiter . $current_before . $thecat . $page_title . $current_after;
        } else {
          echo $current_before . $thecat .$page_title . $current_after . $delimiter . '<a href="' . get_permalink( 7372 ) . '">' . __( 'Your post type' ) . '</a>';
        }

      } elseif ( x_is_portfolio() ) {

        echo $current_before . get_the_title() . $current_after;

      } elseif ( x_is_portfolio_item() ) {

        $link  = x_get_parent_portfolio_link();
        $title = x_get_parent_portfolio_title();

        if ( $is_ltr ) {
        echo '<a href="' . $link . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
        } else {
        echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . $link . '">' . $title . '</a>';
        }

      } elseif ( x_is_product() ) {

        if ( $is_ltr ) {
        echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
        } else {
        echo $current_before . $page_title . $current_after . $delimiter . $shop_link;
        }

      } elseif ( x_is_buddypress() ) {

        if ( bp_is_group() ) {
        echo '<a href="' . bp_get_groups_directory_permalink() . '">' . x_get_option( 'x_buddypress_groups_title' ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;
        } elseif ( bp_is_user() ) {
        echo '<a href="' . bp_get_members_directory_permalink() . '">' . x_get_option( 'x_buddypress_members_title' ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;
        } else {
        echo $current_before . x_buddypress_get_the_title() . $current_after;
        }

      } elseif ( x_is_bbpress() ) {

        remove_filter( 'bbp_no_breadcrumb', '__return_true' );

        if ( bbp_is_forum_archive() ) {
        echo $current_before . bbp_get_forum_archive_title() . $current_after;
        } else {
        echo bbp_get_breadcrumb();
        }

        add_filter( 'bbp_no_breadcrumb', '__return_true' );

      } elseif ( is_page() && ! $post_parent ) {

        echo $current_before . $page_title . $current_after;

      } elseif ( is_page() && $post_parent ) {

        $parent_id   = $post_parent;
        $breadcrumbs = array();

        if ( is_rtl() ) {
        echo $current_before . $page_title . $current_after . $delimiter;
        }

        while ( $parent_id ) {
        $page          = get_page( $parent_id );
        $breadcrumbs[] = '<a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a>';
        $parent_id     = $page->post_parent;
        }

        if ( $is_ltr ) {
        $breadcrumbs = array_reverse( $breadcrumbs );
        }

        for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) {
        echo $breadcrumbs[$i];
        if ( $i != count( $breadcrumbs ) -1 ) echo $delimiter;
        }

        if ( $is_ltr ) {
        echo $delimiter . $current_before . $page_title . $current_after;
        }

      } elseif ( is_tag() ) {

        echo $current_before . single_tag_title( '', false ) . $current_after;

      } elseif ( is_author() ) {

        GLOBAL $author;
        $userdata = get_userdata( $author );
        echo $current_before . __( 'Posts by ', '__x__' ) . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';

      } elseif ( is_404() ) {

        echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after;

      } elseif ( is_archive() ) {

        if ( x_is_shop() ) {
        echo $current_before . $shop_title . $current_after;
        } else {
        echo $current_before . __( 'Archives ', '__x__' ) . $current_after;
        }

      }

      echo '</div>';

    }

  }
endif;

I added this section:

          $customcategory = get_the_terms( $post->ID, 'Your post type' );     
          foreach ( $customcategory as $cat){
             $thecat = $cat->name;
          }

You need to change the Your Post Type to the post type you are using.

Thank you.

Thanks! This looks like the trick, sadly it doesn’t work.

www.loringengineers.com/wp/projects

select a project and you can see the breadcrumb is missing “thecat” looks like its not getting populated or something. What would work is the page name from where we just came from. The “back” url would work with some way of putting slug in there.

PS I tested to see if the new script was loading by changing the parent URL reference and it 404ed so it was def loading new code.

Thanks again!

Beck

Hi @becktowery,

Is it possible if you provide us access to your Wordpress Dashboard and FTP access using the Secure Note functionality of the post to follow up the case?

That way it will be easier for us to test your custom post type and make sure it works correctly.

Thank you.

Done.,
Thanks. The breadcrumbs script is in a plugin called loring projects

Hi there,

Thank you for providing the information. I changed the code to this:

      $customcategory = get_the_terms( $post->ID, 'project_sector' );     
      foreach ( $customcategory as $cat){
         $thecat = $cat->name;
      }

      echo '<a href="' . get_permalink( 65 ) . '">' . __( 'projects' ) . '</a>' . $delimiter . $current_before . $thecat . $delimiter . $page_title . $current_after;
    } else {
      echo $current_before . $thecat . $delimiter .$page_title . $current_after . $delimiter . '<a href="' . get_permalink( 65 ) . '">' . __( 'projects' ) . '</a>';
    }

As you can see the code is basically the same but I used the TAXANOMY instead of the custom post type name. The taxanomy is the one which you used to add the custom post type category, so instead of projects you should use project_sector.

As you may already know customizations like this is outside of our support scope, and we always give guidance to you to do the customization. Further customization of that section will be on your shoulders.

Thank you for your understanding.

Thanks! This is very helpful! Love the X!

Thank you for using our product :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.