Viewing 8 replies - 1 through 8 (of 8 total)
  • Probably the best way to do so is to define a custom “walker” for the nav menu; but I haven’t done that yet, so I can’t give much guidance on what the “walker” needs to do.

    Very crude:

    <?php
    $test = wp_nav_menu( 'echo=0' );
    $test = explode("\n", $test);
    ?>

    Thread Starter cannon303

    (@cannon303)

    Curtiss Grymala yes I have no experience of “walker” either I’ll have to see if i can learn it and esmi yup that seems to be the road i’m going down. My php is usually crude!

    Thanks for both of your replies, the quest continues….

    Thread Starter cannon303

    (@cannon303)

    This is the third thread I’ve posted on this subject and completely drawn a blank, I can’t believe this is so difficult!

    wp_nav_menu() is a relatively new function and – unlike some of the older templating tags – it isn’t built upon lower level functions that can be successfully re-used. A custom Walker class is definitely the best way to go but, like Curtiss, it’s not something I’ve had reason to play with yet.

    Thread Starter cannon303

    (@cannon303)

    yes I’m looking into walkers, it’s very difficult to get my head round it especially as i can’t see anyone asking the same question as i am in the context of walkers.

    Thread Starter cannon303

    (@cannon303)

    Well I’ve pretty much exhausted every walker tutorial and forum query. There just isn’t enough out there to help me with what i want.

    I wouldn’t class myself as possessing a thorough and in depth knowledge of PHP being self taught, but can generally get by, however I’m no better equipped to grapple the concept of wordpress walkers and therefore no closer to my goal and have to admit defeat.

    There’s a workaround function tutorial which I followed and that works how I want the menu to work. This doesn’t work with any menus set up in admin=>appearance=>menus and doesn’t work with wp_nav_menu() function but instead, uses the hierarchical structure of the old style parent attributes in the admin=> pages facility.

    It’s a shame because my clients will understand the graphical nature of the menu editing facility and the drag and drop method and instead they will have to assign parents to sub pages and sub page parents to sub – sub pages via drop down menus and will have to give each page a numerical order ID to assign placement within the menu which is confusing to say the least.

    What a shame. I would like to leave this thread open please as I would like to crack this even if it is too late for this deadline.

    I had the same issue, implementing a Bootstrap-based design onto a WordPress template. My solution ain’t elegant, but it works:

    [code moderated per forum rules– to share your solution, please use the pastebin]

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘wp_nav_menu => array’ is closed to new replies.