Forums

[resolved] wp_page_menu custom classes (3 posts)

  1. sbjluke
    Member
    Posted 6 months ago #

    Using the <?php wp_page_menu( 'sort_column=menu_order' ); ?> code, the browser returns <div class="menu"><ul><li class="page_item page-item-711 current_page_item"><a href="http://localhost/wordpress/" title="Home">Home</a></li><li class="page_item page-item-713"><a href="http://localhost/wordpress/?page_id=713" title="Blog">Blog</a></li><li class="page_item page-item-707"><a href="http://localhost/wordpress/?page_id=707" title="About">About</a></li><li class="page_item page-item-23"><a href="http://localhost/wordpress/?page_id=23" title="Contact Us">Contact Us</a></li></ul></div>

    I'm wondering if I can define my own class name instead of the long page_item page-item-713 that it gives each li.

    Thanks!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 6 months ago #

    Not when using wp_page_menu(), no. You'd need to build your own page listing function for that.

  3. sbjluke
    Member
    Posted 6 months ago #

    Great, Thanks! Should probably learn how to make custom functions anyhow...

Reply

You must log in to post.

About this Topic