所以我想弄清楚是否有可能像现在一样在页脚中显示我的页面链接,但是,在 4 个链接之后,创建一个新ul
链接并填充另外 4 个链接。此外,将显示的链接总数限制为 8 个。因此,基本上允许在两个列表中。
这可能吗?我的代码..
// the footer menu (should you choose to use one)
function bones_footer_links() {
// display the wp3 menu if available
wp_nav_menu(array(
'container' => '', // remove nav container
'container_class' => 'footer-links clearfix', // class of container (should you choose to use it)
'menu' => __( 'Footer Links', 'bonestheme' ), // nav name
'menu_class' => 'nav footer-nav clearfix', // adding custom nav class
'theme_location' => 'footer-links', // where it's located in the theme
'before' => '', // before the menu
'after' => '', // after the menu
'link_before' => '', // before each link
'link_after' => '', // after each link
'depth' => 4, // limit the depth of the nav
'fallback_cb' => 'bones_footer_links_fallback' // fallback function
));
} /* end bones footer link */
// this is the fallback for footer menu
function bones_footer_links_fallback() {
wp_page_menu( array(
'show_home' => true,
'menu_class' => 'nav bottom-nav clearfix', // adding custom nav class
'include' => '',
'exclude' => '',
'echo' => true,
'link_before' => '', // before each link
'link_after' => '' // after each link
) );
}
这给了我:
<ul>
<li><a href="#" title="">Link</a></li>
<li class="page_item page-item-9 current_page_item"><a href="#">Link</a></li>
<li class="page_item page-item-46"><a href="#">Link</a></li>
<li class="page_item page-item-42"><a href="#">Link</a></li>
<li class="page_item page-item-44"><a href="#">Link</a>
</ul>
我想要的是在 4 个链接之后,一个ul
像这样的新链接:
<ul class="list_third">
<li><a href="#">link text</a></li>
<li><a href="#">link text</a></li>
<li><a href="#">link text</a></li>
<li><a href="#">link text</a></li>
</ul>
<ul class="list_third">
<li><a href="#">link text</a></li>
<li><a href="#">link text</a></li>
<li><a href="#">link text</a></li>
<li><a href="#">link text</a></li>
</ul>
总共显示最多 8 个链接。