Replace the WooCommerce default page Navigation
If you need to then manually replace the WooCommerce default page navigation then add this code to your current themes functions.php file:
/** * Replace WooCommerce Default Pagination with WP-PageNavi Pagination * * @author WPSnacks.com * @link http://www.wpsnacks.com */ remove_action('woocommerce_pagination', 'woocommerce_pagination', 10); function woocommerce_pagination() { wp_pagenavi(); } add_action( 'woocommerce_pagination', 'woocommerce_pagination', 10);
How to Get Custom Menu Items
add_filter('wp_nav_menu_items', 'wp_nav_menu_custom', 10, 2); function wp_nav_menu_custom($items, $args) { if( $args->theme_location == 'primary' ) { $menu_name = 'primary'; $locations = get_nav_menu_locations(); //echo '<pre/>'; print_r($locations); die; $menu = wp_get_nav_menu_object(4, $menu_name ); $menuitems = wp_get_nav_menu_items( $menu->term_id , array( 'order' => 'DESC' ) ); foreach ( $menuitems as $item ){ $id = get_post_meta( $item->ID,'_menu_item_object_id', true ); echo '<br/>'; echo $id; //$page = get_page( $id ); //$link = get_page_link( $id ); } } }