沃克菜单活动页面

时间:2017-08-28 22:18:37

标签: php css wordpress wp-nav-walker

我有一个很棒的步行菜单......

// HEADER

<td class="main-nav">
<?php
$args = array(
    'theme_location' => 'primary',
    'walker' => new Walker_Menu
);
wp_nav_menu( $args );
?>
</td>

//FUNCTIONS

class Walker_Menu extends Walker {

var $db_fields = array(
    'parent' => 'menu_item_parent', 
    'id'     => 'db_id' 
);

function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
    $output .= sprintf( "\n<li><a href='%s'%s>%s</a></li>\n",
        $item->url,
        ( $item->object_id === get_the_ID() ) ? ' class="sliding-middle-out current"' : ' class="sliding-middle-out"',
        $item->title
    );
}

}

如何突出显示活动页面......类似

<?php

header(" echo home_url(); /". $_GET['pagetitle'] );

$mo = $_GET['pagetitle'];

?>

然后添加一些css或??

任何非常感谢的帮助

0 个答案:

没有答案