Customising Links (removing “li” etc..)
-
I’m looking to edit the code so that I can display links without
“li” tags around them. I am assuming the code I need to edit is…function wp_list_pages($args = '') { $defaults = array( 'depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), 'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => '', 'sort_column' => 'menu_order, post_title' ); $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); $output = ''; $current_page = 0; // sanitize, mostly to keep spaces out $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']); // Allow plugins to filter an array of excluded pages $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude']))); // Query pages. $r['hierarchical'] = 0; $pages = get_pages($r); if ( !empty($pages) ) { if ( $r['title_li'] ) $output .= '<li class="pagenav">' . $r['title_li'] . '<ul>'; global $wp_query; if ( is_page() || $wp_query->is_posts_page ) $current_page = $wp_query->get_queried_object_id(); $output .= walk_page_tree($pages, $r['depth'], $current_page, $r); if ( $r['title_li'] ) $output .= '</ul></li>'; } $output = apply_filters('wp_list_pages', $output); if ( $r['echo'] ) echo $output; else return $output; }
So I can see where the UL is etc… but I cant figure out how they create the code for each link and add the “li” tags etc… Can anyone help?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Customising Links (removing “li” etc..)’ is closed to new replies.