Bogdanovskaya
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Я установила шаблон, меня он всем устраивает, кроме рубрик в шаблоне, во-первых, рубрик много, а во-вторых, вложенность не во всех корректно отображается и получается еще больше рубрик в шапке. Я хотела бы их заменить на страницы, но не знаю как (( WordPress3.0.4, тема Bombax 1.3 от itx, нашла и скачала ее вчера, через установщик тем в админке - это свежая тема. Сайт artlife.rnd-sale.ru Делаю маме подарок )) Она просила, вот сегодня пойду вечером к ней, хотела уже показать готовый сайт, но вышла засада с рубриками. Заголовок (header.php) Цитата: <?php /** * Functions to handle the custom header * * @package itx_themes * @version 2.1 */ define('HEADER_IMAGE', itx_header_bg_default()); define('HEADER_IMAGE_WIDTH', itx_header_bg_width()); define('HEADER_IMAGE_HEIGHT', itx_get_option('header','bg_height')); define('NO_HEADER_TEXT', true ); define('HEADER_TEXTCOLOR', ''); add_custom_image_header('',''); if (function_exists('register_default_headers')){ register_default_headers(itx_setting('head_bg')); } function itx_header_bg_default(){ $headbg=$headbg=itx_setting('head_bg',itx_default_option('header','head_bg')); return $headbg['url']; } function itx_header_bg_width(){ extract(itx_get_option('layout')); if ($wrapping=='fixed') return $wrap; else return $max_width; } function itx_header(){ extract(itx_get_option('header')); if ($head_type==1){ echo' <div id="headerwrap">'; if (!$scope) echo '<div id="header" class="wrap">'; echo '<div class="clear"></div> <a href="'.get_option('home').'/" title="'.htmlspecialchars(get_bloginfo('name')).'"> <img src="'.$logo.'" alt="'.htmlspecialchars(get_bloginfo('name')).'" title="'.htmlspecialchars(get_bloginfo('name')).'" /> </a>'; if (!$scope) echo '</div>'; echo '</div>'; }else{ echo' <div id="headerwrap"><div class="clear"></div> <div id="header" class="wrap">'; if ( is_home() || is_front_page() ){ echo '<h1 class="header"><a href="'.get_option('home').'">'.get_bloginfo('name').'</a></h1>'; } else { echo '<div class="header"><a href="'.get_option('home').'">'.get_bloginfo('name').'</a></div>'; } echo'<span class="tagline">'.get_bloginfo('description').'</span> </div> </div>'; } } function itx_header_styles(){ $halfwrap=$fullwrap=''; extract(itx_get_option('header')); $height=empty($height)?'':" height:$height;"; if (function_exists('register_default_headers')){ $bg=(empty($image))?get_header_image():$image; } else { if (!get_theme_mod('header_image')){ $headbg=itx_setting('head_bg',$head_bg); $bg=sprintf($headbg['url'],get_template_directory_uri()); } if (empty($bg)) $bg=$image; } $bg=(empty($bg))?'':"url($bg)"; $img="background:$bgcolor $bg $repeat $h_align $v_align;$height"; if ($scope==1) $fullwrap=$img; else $halfwrap=$img; if (itx_get_option('layout','wrapping')=='fixed') $maxw=itx_get_option('layout','wrap').'px'; else $maxw='98%'; echo " #headerwrap{ $fullwrap text-align: $text_align;} #header{ $halfwrap } #header .header {font-size: {$font_size};} #header .header a {color: $color;text-decoration: none;} #header .header a:hover {color: $hover_color;} #header img{max-width:$maxw;} #header .tagline {font-size: {$span_font_size};color: $span_color;}"; } add_action('itx_styles','itx_header_styles'); ?> | navigation.php Цитата: <?php /** * Things to alter navigation menu * * @package itx_themes * @subpackage dual * @version 2.0 */ /** * Function to display navigation menu: Primary Navigation and Top Navigation. * * @uses wp_nav_menu() * * @see wp_nav_menu() For possible values for the parameter. * @param string|array $args Optional. Override defaults. */ function itx_menu($args=''){ extract(itx_get_option('menu')); $args=(wp_parse_args($args)); if ( function_exists('wp_nav_menu') && !empty($wp_menu)){ if ($args['theme_location']=='top') { $home=$top_home; $depth=$top_depth; } $passed_args=array('container'=>false,'fallback_cb'=>'itx_menu_','depth'=>$depth); wp_nav_menu(wp_parse_args($passed_args,$args)); return; } else itx_menu_($args); } /** * Function to display navigation menu in if user choose to use itx Menu or for older than WordPress 3.0 users * */ function itx_menu_($args){ $cat_inc=$page_inc=0; $menu_class=''; extract(itx_get_option('menu')); extract(wp_parse_args($args)); if($theme_location=='top'){ $home=$top_home; $depth=$top_depth; $show=$top_show; } if ($show){ echo '<ul class="'.$menu_class.'">'; if ($home) echo '<li><a href="'.get_option('home').'">'.$home.'</a></li>'; if ($cat_inc){ @sort($cat_inc); $cat_inc=@implode(',',$cat_inc); $opt="&include=$cat_inc"; if ($cat_sortby) {$opt.="&orderby=".$cat_sortby;}; if ($cat_order) {$opt.="&order=".$cat_order;}; $cat_args="title_li=&depth=$depth$opt"; } else { $cat_args='title_li=&number=9'; } if ($page_inc){ @sort($page_inc); $page_inc=@implode(',',$page_inc); $opt="&include=$page_inc"; if ($cat_sortby) {$opt.="&orderby=".$cat_sortby;}; if ($cat_order) {$opt.="&order=".$cat_order;}; $page_args="title_li=&depth=$depth$opt"; } else { $page_args='title_li=&number=9'; } if ($show=='cat'){ wp_list_categories($cat_args); } elseif ($show=='page'){ wp_list_pages($page_args); } elseif ($show=='cp'){ wp_list_categories($cat_args); wp_list_pages($page_args); } elseif ($show=='pc'){ wp_list_pages($page_args); wp_list_categories($cat_args); } echo'</ul>'; } } function itx_menu_styles(){ extract(itx_get_option('menu')); $bgcolor=(!empty($top_bg_color))?$top_bg_color:'transparent'; echo " ul.top-menu{margin:0 {$top_margin}px;float:{$top_align};background-color:$bgcolor;}"; } add_action('itx_styles','itx_menu_styles'); if ( function_exists('wp_nav_menu')&&itx_get_option('menu','wp_menu')){ register_nav_menu( 'top' , 'Top Navigation' ); register_nav_menu( 'primary' , 'Primary Navigation'); } ?> |
|