<?php /** * the custom taxonomy template * This file is loaded by WordPress on custom taxonomies. You can further customize this template * for specific taxonomies by copying this file to taxonomy-yourTaxonomyName.php */ get_header(); global $loop_module_id, $loop_sidebar_position; // get the current taxonomy object - note that it's note complete $current_term_obj = get_queried_object(); //read the loop variables for this specific taxonomy $loop_module_id = td_util::get_taxonomy_option($current_term_obj->taxonomy, 'tds_taxonomy_page_layout'); $loop_sidebar_position = td_util::get_taxonomy_option($current_term_obj->taxonomy, 'tds_taxonomy_sidebar_pos'); if (empty($loop_module_id)) { $loop_module_id = 1; // module_1 is the default } // sidebar position used to align the breadcrumb on sidebar left + sidebar first on mobile issue $td_sidebar_position = ''; if ($loop_sidebar_position == 'sidebar_left') { $td_sidebar_position = 'td-sidebar-left'; } ?> <div class="td-main-content-wrap"> <div class="td-container <?php echo $td_sidebar_position; ?> "> <div class="td-crumb-container">
/* ---------------------------------------------------------------------------- sidebar from page - set in the page setting */ dynamic_sidebar($td_page['td_sidebar']); } else { if (td_global::$current_template == 'woo') { //woo commerce td_util::show_sidebar('woo'); } elseif (td_global::$current_template == 'woo-single') { td_util::show_sidebar('woo-single'); } elseif (td_global::$current_template == 'bbpress') { td_util::show_sidebar('bbpress'); } elseif (is_tax()) { // custom taxonomies $current_term_obj = get_queried_object(); $tds_taxonomy_sidebar = td_util::get_taxonomy_option($current_term_obj->taxonomy, 'tds_taxonomy_sidebar'); if (!empty($tds_taxonomy_sidebar)) { dynamic_sidebar($tds_taxonomy_sidebar); } else { //show default if available if (!dynamic_sidebar(TD_THEME_NAME . ' default')) { ?> <!-- no sidebar --> <?php } } } elseif (is_category()) { // sidebar from category on category page $curCategoryID = get_query_var('cat'); $tax_meta_sidebar = td_util::get_category_option($curCategoryID, 'tdc_sidebar_name'); ////swich by RADU A, get_tax_meta($curCategoryID, 'tdc_sidebar_name');
/** * Reads an individual setting - only one setting! * @param $read_array - * 'ds' => 'data source ID', 'item_id' = > 'the category id for example', - OPTIONAL category id or author id or page id * 'option_id' => 'the option id ex: background' * @return returns the value of the setting */ static function read($read_array) { switch ($read_array['ds']) { case 'td_taxonomy': return td_util::get_taxonomy_option($read_array['item_id'], $read_array['option_id']); break; case 'td_cpt': return td_util::get_ctp_option($read_array['item_id'], $read_array['option_id']); break; case 'td_category': return td_util::get_category_option($read_array['item_id'], $read_array['option_id']); break; case 'td_option': return td_util::get_option($read_array['option_id']); //htmlspecialchars() break; case 'wp_option': return htmlspecialchars(get_option($read_array['option_id'])); break; case 'td_homepage': // here we get all the options for the homepage (including widgets?) break; case 'td_page_option': break; case 'td_widget': break; //author metadata //author metadata case 'td_author': return get_the_author_meta($read_array['option_id'], $read_array['item_id']); break; //wordpress theme mod datasource //wordpress theme mod datasource case 'wp_theme_mod': return htmlspecialchars(get_theme_mod($read_array['option_id'])); break; //wordpress usermenu to menu spot datasource //wordpress usermenu to menu spot datasource case 'wp_theme_menu_spot': $menu_spots_array = get_theme_mod('nav_menu_locations'); //check to see if there is a menu assigned to that particular option_id (menu id) if (isset($menu_spots_array[$read_array['option_id']])) { return $menu_spots_array[$read_array['option_id']]; } else { return ''; } break; //translation data source //translation data source case 'td_translate': //get all the translations (they are stored in the td_008 variable) $translations = td_util::get_option('td_translation_map_user'); if (!empty($translations[$read_array['option_id']])) { return $translations[$read_array['option_id']]; //htmlspecialchars() } else { return ''; } //return td_util::get_option($read_array['option_id']); break; //read the ads parameters //[ds] => td_ads [option_id] => current_ad_type [item_id] => header - has to become [item_id][option_id] //read the ads parameters //[ds] => td_ads [option_id] => current_ad_type [item_id] => header - has to become [item_id][option_id] case 'td_ads': //get all the ad spots (they are stored in the td_008 variable) $ads = td_util::get_option('td_ads'); if (!empty($ads[$read_array['item_id']]) and !empty($ads[$read_array['item_id']][$read_array['option_id']])) { return htmlspecialchars($ads[$read_array['item_id']][$read_array['option_id']]); } else { return ''; } break; //social networks //social networks case 'td_social_networks': $social_array = td_util::get_option('td_social_networks'); if (!empty($social_array[$read_array['option_id']])) { return $social_array[$read_array['option_id']]; } else { return ''; } break; case 'td_fonts_user_insert': $fonts_user_inserted = td_util::get_option('td_fonts_user_inserted'); if (!empty($fonts_user_inserted[$read_array['option_id']])) { return $fonts_user_inserted[$read_array['option_id']]; } break; case 'td_fonts': $fonts_user_inserted = td_util::get_option('td_fonts'); if (!empty($fonts_user_inserted[$read_array['item_id']][$read_array['option_id']])) { return $fonts_user_inserted[$read_array['item_id']][$read_array['option_id']]; } break; case 'td_block_styles': //get the hole block style array $td_block_styles = td_util::get_option('td_block_styles'); if (!empty($td_block_styles) and !empty($td_block_styles[$read_array['item_id']][$read_array['option_id']])) { return $td_block_styles[$read_array['item_id']][$read_array['option_id']]; } break; // fake datasource for demo import panel, we just use the panel to render controls but we save on our own @todo - find a solution to this // fake datasource for demo import panel, we just use the panel to render controls but we save on our own @todo - find a solution to this case 'td_import_theme_styles': break; // fake datasource for metaboxes, we just use the panel to render controls but we save on our own @todo - find a solution to this // fake datasource for metaboxes, we just use the panel to render controls but we save on our own @todo - find a solution to this case 'td_page': break; case 'td_homepage_loop': break; case 'td_post_theme_settings': break; case 'td_update_theme_options': break; default: // try to get options for plugins return tdx_options::get_option($read_array['ds'], $read_array['option_id']); //return tdx_api_panel::get_data_from_datasource($read_array['ds'], $read_array['option_id']); break; } }