Php 无法使活动状态在nav中工作
我正在wordpress中建立一个自定义站点。在我的CSS中,除了活动状态之外,我已经能够为我的主导航获得所有正确的样式。除了在悬停上加下划线的导航项目外,我希望当您在所选页面上时,它保持加下划线。我似乎无法找出我的代码中的错误 CSS 标题PHP:Php 无法使活动状态在nav中工作,php,css,wordpress,navigation,Php,Css,Wordpress,Navigation,我正在wordpress中建立一个自定义站点。在我的CSS中,除了活动状态之外,我已经能够为我的主导航获得所有正确的样式。除了在悬停上加下划线的导航项目外,我希望当您在所选页面上时,它保持加下划线。我似乎无法找出我的代码中的错误 CSS 标题PHP: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&
<!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">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="distribution" content="global" />
<meta name="robots" content="follow, all" />
<meta name="language" content="it, en" />
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<meta name="generator" content="HandymanLasVegas<?php bloginfo('version'); ?>" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/prototype.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/scriptaculous.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/combo.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/lightbox.js"></script>
<?php wp_head(); ?>
<style type="text/css" media="screen">
<!-- @import url( <?php bloginfo('stylesheet_url'); ?> ); -->
</style>
</head>
<body>
<div id="header">
<div id="topbg">
<div id="navmenu">
<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
<div id="social">
<a href="https://www.facebook.com/American-Handyman-Services-Inc-259437720757501/timeline" target="_blank"><img src="http://ahsvegas.com/wp-content/uploads/2015/12/AHS_Facebook.png" width="55" height="55" /></a>
<a href="mailto:test@test.com"><img src="http://ahsvegas.com/wp-content/uploads/2015/12/AHS_Email.png" width="55" height="55"/></a>
</div>
</div>
</div>
<a title="Home" href="http://www.ahsvegas.com"><div id="logo" style="cursor: pointer;"></div></a>
</div>
<div id="box">
<!-- end header -->
Wordpress正在li上添加类“current_page_item”,因此在css中使用#navmenu ul li。当前页面项目a
而不是#navmenu ul li a:active
Wordpress正在li上添加类“当前页面项目”,因此在css中使用#navmenu ul li。当前页面_项目a
而不是
#导航菜单ul li a:活动链接到站点:链接到站点:
<!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">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="distribution" content="global" />
<meta name="robots" content="follow, all" />
<meta name="language" content="it, en" />
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
<meta name="generator" content="HandymanLasVegas<?php bloginfo('version'); ?>" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_get_archives('type=monthly&format=link'); ?>
<!--[if lt IE 7.]>
<script defer type="text/javascript" src="pngfix.js"></script>
<![endif]-->
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/prototype.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/scriptaculous.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/combo.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/lightbox.js"></script>
<?php wp_head(); ?>
<style type="text/css" media="screen">
<!-- @import url( <?php bloginfo('stylesheet_url'); ?> ); -->
</style>
</head>
<body>
<div id="header">
<div id="topbg">
<div id="navmenu">
<?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
<div id="social">
<a href="https://www.facebook.com/American-Handyman-Services-Inc-259437720757501/timeline" target="_blank"><img src="http://ahsvegas.com/wp-content/uploads/2015/12/AHS_Facebook.png" width="55" height="55" /></a>
<a href="mailto:test@test.com"><img src="http://ahsvegas.com/wp-content/uploads/2015/12/AHS_Email.png" width="55" height="55"/></a>
</div>
</div>
</div>
<a title="Home" href="http://www.ahsvegas.com"><div id="logo" style="cursor: pointer;"></div></a>
</div>
<div id="box">
<!-- end header -->