<?php /** * @package WordPress * @subpackage U-Design */ global $udesign_options; // construct an array of portfolio categories $portfolio_categories_array = explode(',', $udesign_options['portfolio_categories']); if ($portfolio_categories_array != "" && post_is_in_category_or_descendants($portfolio_categories_array)) { // Test if this Post is assigned to the Portfolio category or any descendant and switch the single's template accordingly include 'single-Portfolio.php'; } else { // Continue with normal Loop (Blog category) get_header(); $content_position = $udesign_options['blog_sidebar'] == 'left' ? 'grid_16 push_8' : 'grid_16'; if ($udesign_options['remove_single_sidebar'] == 'yes') { $content_position = 'grid_24'; } ?> <div id="content-container" class="container_24"> <div id="main-content" class="<?php echo $content_position; ?> "> <div class="main-content-padding"> <?php do_action('udesign_above_page_content'); if (have_posts()) { while (have_posts()) { the_post();
/** * 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; } } } else { // if the current category is a regular blog category echo get_category_parents($id, $link, $separator, FALSE); } }