Witam,
czy ktoś może mi pomóc przerobić ten kod:
function _generate_navigation() {
$ps = get_pages('sort_column=menu_order,post_title&sort_order=asc&parent=0');
$html = '';
foreach($ps as $p) {
$active = is_page($p->post_name) ? 'class="active"' : '';
$active = $p->post_name == 'blog' && !is_page() ? 'class="active"' : $active;
$html .= '<a ' . $active . ' href="' . get_permalink($p->ID) . '"><span>' . $p->post_title . '</span></a>';
}
return $html;
}
pod ten tutaj co jest wypisany na górze:
add_action (‘init’, ‘register_wlasne_menu’);
function register_wlasne_menu() {
register_nav_menu (‘wlasne_topmenu’, ’NoweMenu’);
}