0
wp_list_pages에서 맞춤 보행기를 사용하고 있습니다. 이제 자녀가있는 경우 $ link 및 $ checkchildren의 값을 변경하려고합니다.wp_list_pages 어린이가 없는지 확인하십시오.
나는이 아이
$children = wp_list_pages(array(
'sort_column' => 'menu_order',
'title_li' => '',
'echo' => 1,
'walker' => new Sidebar_Custom_Walker()
));
class Sidebar_Custom_Walker extends Walker_Page {
function start_el(&$output, $page, $depth, $args, $current_page = 0) {
$output .= $indent . '<li class="rtChild">';
$linkcss ="c1"; // should be blank if no children
$output .= '<a href="' . get_permalink($page->ID) . '" class="'.$linkcss .'">' . $link_before;
$output .= apply_filters('the_title', $page->post_title, $page->ID);
$output .= $link_after . '</a>
$checkchildren = '<span class="plusBtn"></span>'; // should be blank if no children
$output .= $checkchildren;
}
}