tsonade
سه شنبه 29 اسفند 1391, 13:54 عصر
سلام
من می خوام به صورت دستی یک سری منو و زیر منو به این قالب اضافه کنم
خود قالب از کد
<?php show_categories_menu($menuClass,false); ?>
برای ایجاد دسته استفاده کرده اما من می خوام این رو حذف کنم و دستی اضافه کنم
فقط مشکلی دارم
وقتی کد
<ul>
<li>
link1
</li>
</ul>
درست نمایش نمیدشون
به این شکل عمل کردم
این قالب دارای دو منو هست
منو : top-menu
منو دوم : secondary-menu
من می خوام این دسته ها رو به secondary-menuاضافه کنم
کد هاش header.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php elegant_titles(); ?></title>
<?php elegant_description(); ?>
<?php elegant_keywords(); ?>
<?php elegant_canonical(); ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie6style.css" />
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">DD_belatedPNG.fix('img#logo');</script>
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie7style.css" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie8style.css" />
<![endif]-->
<script type="text/javascript">
document.documentElement.className = 'js';
</script>
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>
</head>
<?php $et_body_class = get_option('estore_cufon') == 'false' ? 'cufon-disabled' : 'cufon-enabled'; ?>
<body<?php if (is_home()) echo(' id="home"'); ?> <?php body_class( $et_body_class ); ?>>
<div id="header">
<div class="container clearfix">
<a href="<?php bloginfo('url'); ?>"><?php $logo = (get_option('estore_logo') <> '') ? get_option('estore_logo') : get_bloginfo('template_directory').'/images/logo.png'; ?>
<img src="<?php echo esc_url($logo); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>" id="logo"/></a>
<?php $menuClass = 'nav superfish clearfix';
$menuID = 'top-menu';
$primaryNav = '';
if (function_exists('wp_nav_menu')) {
$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) );
};
if ($primaryNav == '') { ?>
<ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
<?php if (get_option('estore_swap_navbar') == 'false') { ?>
<?php if (get_option('estore_home_link') == 'on') { ?>
<?php show_page_menu($menuClass,false,false); ?>
<?php } else { ?>
<?php show_categories_menu($menuClass,false); ?>
<?php } ?>
<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>"><?php esc_html_e('صفحه اصلی','eStore') ?></a></li>
<ul> <?php }; ?>
<li>adwadAW</li>
<li>adwadAW</li>
<li>adwadAW</li>
</ul>
</ul> <!-- ul#nav -->
<?php }
else echo($primaryNav); ?>
<div id="search-bar">
<form method="get" id="searchform1" action="<?php echo home_url(); ?>">
<input type="text" value="<?php esc_attr_e('جستجو در سایت...','eStore'); ?>" name="s" id="searchinput" />
<input type="image" src="<?php bloginfo('template_directory'); ?>/images/search-icon.png" id="searchsubmit" />
</form>
</div> <!-- #search-bar -->
<div id="menu">
<?php $menuClass = 'nav superfish clearfix';
$menuID = 'secondary-menu';
$secondaryNav = '';
if (function_exists('wp_nav_menu')) {
$secondaryNav = wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false, 'walker' => new description_walker() ) );
};
if ($secondaryNav == '') { ?>
<ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
<?php if (get_option('estore_swap_navbar') == 'false') { ?>
<?php show_categories_menu($menuClass,false); ?>
<?php } else { ?>
<?php if (get_option('estore_home_link') == 'on') { ?>
<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>"><?php esc_html_e('Home','eStore') ?></a></li>
<?php }; ?>
<?php show_page_menu($menuClass,false,false); ?>
<?php } ?>
</ul> <!-- end ul#nav -->
<?php }
else echo($secondaryNav); ?>
</div> <!-- #menu -->
</div> <!-- .container -->
</div> <!-- #header -->
<?php if (get_option('estore_featured') == 'on' && (is_home() || is_front_page())) get_template_part('includes/featured'); ?>
<div id="content" <?php global $fullwidth; if ( is_page_template('page-full.php') || $fullwidth ) echo 'class="no_sidebar"'?>>
<div class="container clearfix">
امدم کد زیر را حذف کردم
<div id="menu">
$menuID = 'secondary-menu';
<?php $menuClass = 'nav superfish clearfix';
$secondaryNav = '';
if (function_exists('wp_nav_menu')) {
$secondaryNav = wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false, 'walker' => new description_walker() ) );
};
if ($secondaryNav == '') { ?>
<ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
<?php if (get_option('estore_swap_navbar') == 'false') { ?>
<?php show_categories_menu($menuClass,false); ?>
<?php } else { ?>
<?php if (get_option('estore_home_link') == 'on') { ?>
<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>"><?php esc_html_e('Home','eStore') ?></a></li>
<?php }; ?>
<?php show_page_menu($menuClass,false,false); ?>
<?php } ?>
</ul> <!-- end ul#nav -->
<?php }
else echo($secondaryNav); ?>
</div> <!-- #menu -->
و جاش این کد ها رو قرار دادم
<div id="menu">
<ul><a href="index.php">name menu</a>
<li><a href='#'> link1</a></li>
<li><a href='#'> link2</a> </li>
</ul>
</dive>
اما منو ها رو با استایل و منظم نشون نمیده
به ul ها و li ها در css استایل داده شده نیاز هست اینجا class هاشو فراخوانی کنم ؟
من می خوام به صورت دستی یک سری منو و زیر منو به این قالب اضافه کنم
خود قالب از کد
<?php show_categories_menu($menuClass,false); ?>
برای ایجاد دسته استفاده کرده اما من می خوام این رو حذف کنم و دستی اضافه کنم
فقط مشکلی دارم
وقتی کد
<ul>
<li>
link1
</li>
</ul>
درست نمایش نمیدشون
به این شکل عمل کردم
این قالب دارای دو منو هست
منو : top-menu
منو دوم : secondary-menu
من می خوام این دسته ها رو به secondary-menuاضافه کنم
کد هاش header.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php elegant_titles(); ?></title>
<?php elegant_description(); ?>
<?php elegant_keywords(); ?>
<?php elegant_canonical(); ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie6style.css" />
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">DD_belatedPNG.fix('img#logo');</script>
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie7style.css" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/ie8style.css" />
<![endif]-->
<script type="text/javascript">
document.documentElement.className = 'js';
</script>
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>
</head>
<?php $et_body_class = get_option('estore_cufon') == 'false' ? 'cufon-disabled' : 'cufon-enabled'; ?>
<body<?php if (is_home()) echo(' id="home"'); ?> <?php body_class( $et_body_class ); ?>>
<div id="header">
<div class="container clearfix">
<a href="<?php bloginfo('url'); ?>"><?php $logo = (get_option('estore_logo') <> '') ? get_option('estore_logo') : get_bloginfo('template_directory').'/images/logo.png'; ?>
<img src="<?php echo esc_url($logo); ?>" alt="<?php echo esc_attr(get_bloginfo('name')); ?>" id="logo"/></a>
<?php $menuClass = 'nav superfish clearfix';
$menuID = 'top-menu';
$primaryNav = '';
if (function_exists('wp_nav_menu')) {
$primaryNav = wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false ) );
};
if ($primaryNav == '') { ?>
<ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
<?php if (get_option('estore_swap_navbar') == 'false') { ?>
<?php if (get_option('estore_home_link') == 'on') { ?>
<?php show_page_menu($menuClass,false,false); ?>
<?php } else { ?>
<?php show_categories_menu($menuClass,false); ?>
<?php } ?>
<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>"><?php esc_html_e('صفحه اصلی','eStore') ?></a></li>
<ul> <?php }; ?>
<li>adwadAW</li>
<li>adwadAW</li>
<li>adwadAW</li>
</ul>
</ul> <!-- ul#nav -->
<?php }
else echo($primaryNav); ?>
<div id="search-bar">
<form method="get" id="searchform1" action="<?php echo home_url(); ?>">
<input type="text" value="<?php esc_attr_e('جستجو در سایت...','eStore'); ?>" name="s" id="searchinput" />
<input type="image" src="<?php bloginfo('template_directory'); ?>/images/search-icon.png" id="searchsubmit" />
</form>
</div> <!-- #search-bar -->
<div id="menu">
<?php $menuClass = 'nav superfish clearfix';
$menuID = 'secondary-menu';
$secondaryNav = '';
if (function_exists('wp_nav_menu')) {
$secondaryNav = wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false, 'walker' => new description_walker() ) );
};
if ($secondaryNav == '') { ?>
<ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
<?php if (get_option('estore_swap_navbar') == 'false') { ?>
<?php show_categories_menu($menuClass,false); ?>
<?php } else { ?>
<?php if (get_option('estore_home_link') == 'on') { ?>
<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>"><?php esc_html_e('Home','eStore') ?></a></li>
<?php }; ?>
<?php show_page_menu($menuClass,false,false); ?>
<?php } ?>
</ul> <!-- end ul#nav -->
<?php }
else echo($secondaryNav); ?>
</div> <!-- #menu -->
</div> <!-- .container -->
</div> <!-- #header -->
<?php if (get_option('estore_featured') == 'on' && (is_home() || is_front_page())) get_template_part('includes/featured'); ?>
<div id="content" <?php global $fullwidth; if ( is_page_template('page-full.php') || $fullwidth ) echo 'class="no_sidebar"'?>>
<div class="container clearfix">
امدم کد زیر را حذف کردم
<div id="menu">
$menuID = 'secondary-menu';
<?php $menuClass = 'nav superfish clearfix';
$secondaryNav = '';
if (function_exists('wp_nav_menu')) {
$secondaryNav = wp_nav_menu( array( 'theme_location' => 'secondary-menu', 'container' => '', 'fallback_cb' => '', 'menu_class' => $menuClass, 'menu_id' => $menuID, 'echo' => false, 'walker' => new description_walker() ) );
};
if ($secondaryNav == '') { ?>
<ul id="<?php echo $menuID; ?>" class="<?php echo $menuClass; ?>">
<?php if (get_option('estore_swap_navbar') == 'false') { ?>
<?php show_categories_menu($menuClass,false); ?>
<?php } else { ?>
<?php if (get_option('estore_home_link') == 'on') { ?>
<li <?php if (is_home()) echo('class="current_page_item"') ?>><a href="<?php bloginfo('url'); ?>"><?php esc_html_e('Home','eStore') ?></a></li>
<?php }; ?>
<?php show_page_menu($menuClass,false,false); ?>
<?php } ?>
</ul> <!-- end ul#nav -->
<?php }
else echo($secondaryNav); ?>
</div> <!-- #menu -->
و جاش این کد ها رو قرار دادم
<div id="menu">
<ul><a href="index.php">name menu</a>
<li><a href='#'> link1</a></li>
<li><a href='#'> link2</a> </li>
</ul>
</dive>
اما منو ها رو با استایل و منظم نشون نمیده
به ul ها و li ها در css استایل داده شده نیاز هست اینجا class هاشو فراخوانی کنم ؟