get pages current page item class
-
Hello!
I want to add class to current page item like wp_list_pages.
I lising pages with this code.
$args = array( 'sort_column' => 'menu_order', 'hierarchical' => 1, 'exclude' => '', 'child_of' => 0, 'parent' => -1, 'exclude_tree' => '', 'number' => '', 'offset' => 0, 'post_type' => 'page', 'post_status' => 'publish' ); $pages = get_pages($args); foreach($pages as $page){ echo '<a href="'.get_page_link( $page->ID ).'"><li>'.$page->post_title.'</li></a>'; }Thanks for any reply.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘get pages current page item class’ is closed to new replies.