WordPress沃克2列

时间:2018-12-03 12:20:04

标签: wordpress

我想在wordpress上制作这样的菜单: 2columns

我要改变walker.php,它是这样的:

<?php

class St_Walker extends Walker_Nav_Menu
{

  function start_lvl(&$output, $depth = 0, $args = array()) { //ul
    $indent = str_repeat("\t", $depth);
    $submenu = ($depth > 0) ? ' sub-menu' : '';
    $output .= "\n$indent<ul class=\"dropdown-menu$submenu depth_$depth\">\n";
    $output .= '<h6>' . 'What kind of recruiter are you?' . '</h6>';
   }
  function start_el(&$output, $item, $depth=0, $args=array(), $id = 0) { //li a span  
    $object = $item->object;
    $type = $item->type;
    $title = $item->title;
    $description = $item->description;
    $permalink = $item->url;
    $output .= "<li class='" .  implode(" ", $item->classes) . "'>";
    $output .= '<a href="' . $permalink . '">';
    $output .= $title;
    if( $description != '' && $depth == 1 ) {
      $output .= '<span class="description">' . $description . '</span>';
      $output .= '</a>';
    } else {
      $output .= '</a>';
    }
  }
}
?>

你们有什么帮助吗?

0 个答案:

没有答案
相关问题