• 1.
    These are in the functions.php file. 
  • 2.
        
  • 3.
    /**
  • 4.
     * This function is used to generate custom breadcrumbs for single posts view. Portfolio section or regular Blog is considered
  • 5.
     * when generating the link structure.
  • 6.
     */
  • 7.
    function get_category_parents_for_breadcrumbs( $id, $link = false, $separator = '/' ) {
  • 8.
    	global $udesign_options, $portfolio_pages_array;
  • 9.
    	$portfolio_cats_array = explode( ',', $udesign_options['portfolio_categories'] );
  • 10.
    	if ( post_is_in_category_or_descendants($portfolio_cats_array) ) { // if the current post belongs to any Porfolio category
  • 11.
    	    foreach ( $portfolio_pages_array as $portfolio_page_obj ) {
  • 12.
    		$port_page_ID = $portfolio_page_obj->ID;
  • 13.
    		if ( post_is_in_category_or_descendants( $udesign_options['portfolio_cat_for_page_'.$port_page_ID] ) ) {
  • 14.
    		    echo get_category_parents_for_portfolio_page( $id, $link, $separator, FALSE , $port_page_ID );
  • 15.
    		    break;
  • 16.
    		}
  • 17.
    	    }
  • 18.
    	    
  • 19.
    	    
  • 20.
     /* Load breadcrumbs script */
  • 21.
    if ($udesign_options['show_breadcrumbs'] == 'yes')
  • 22.
        include( 'scripts/breadcrumbs.php' );
  • 23.
        
  • 24.
    	} else { // if the current category is a regular blog category
  • 25.
    	    echo get_category_parents( $id, $link, $separator, FALSE );
  • 26.
    	}
  • 27.
    }
These are in the functions.php file. /** * This function is used to generate custom breadcrumbs for single posts view. Portfolio section or regular Blog is considered * when generating the link structure. */ function get_category_parents_for_breadcrumbs( $id, $link = false, $separator = '/' ) { global $udesign_options, $portfolio_pages_array; $portfolio_cats_array = explode( ',', $udesign_options['portfolio_categories'] ); if ( post_is_in_category_or_descendants($portfolio_cats_array) ) { // if the current post belongs to any Porfolio category foreach ( $portfolio_pages_array as $portfolio_page_obj ) { $port_page_ID = $portfolio_page_obj->ID; if ( post_is_in_category_or_descendants( $udesign_options['portfolio_cat_for_page_'.$port_page_ID] ) ) { echo get_category_parents_for_portfolio_page( $id, $link, $separator, FALSE , $port_page_ID ); break; } } /* Load breadcrumbs script */ if ($udesign_options['show_breadcrumbs'] == 'yes') include( 'scripts/breadcrumbs.php' ); } else { // if the current category is a regular blog category echo get_category_parents( $id, $link, $separator, FALSE ); } }

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter