wp-bootstrap / wp-bootstrap-navwalker

A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.
https://wp-bootstrap.github.io/wp-bootstrap-navwalker/
GNU General Public License v3.0
3.37k stars 1.94k forks source link

Strict Standards Error bootstrap navwalker #22

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi there

Just thought I should bring these issues to your attention.

I've been trying this in a theme but I got the following error:

Strict Standards: Declaration of wp_bootstrap_navwalker::start_lvl() should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in .../wp-content/themes/flat-portfolio/wp_bootstrap_navwalker.php on line 143

I was told on WordPress Answers that It means:

It means that the declaration of the start_lvl method in wp_bootstrap_navwalker should match the declaration of the method in Walker_Nav_Menu. It doesn't.

function start_lvl( &$output, $depth ) { VS.

function start_lvl( &$output, $depth = 0, $args = array() ) { Make the arguments match exactly and you should be fine.

Also I get Notice: Trying to get property of non-object errors with wp-debug set to true if the menu is not set. Please let me know how I can fix this.

Thanks and best

SideQuestDIY commented 11 years ago

Thanks for the feedback, I am currently working on this issue. The walker was built on the default walker from WordPress 3.4 and I see a lot has changed as far as standards go in 3.6 so I think its time I re:wrote the whole class. I am trying to publish the new walker for Bootstrap 3.0 today and then I will be creating a final-ish version for 2.3.

ghost commented 11 years ago

Thanks sounds great :)

prionkor commented 11 years ago

Waiting for your 3.0 version ;)

SideQuestDIY commented 11 years ago

@prionkor The working 3.0 version RC1 can be found here. https://github.com/twittem/wp-bootstrap-navwalker/tree/Bootstrap-3.0+

Just working on some icon issues and the new read me, then we can switch it over to the master branch and retire the old script.

SideQuestDIY commented 11 years ago

wp-bootstrap-navwalker Version 2.0 for Bootstrap 3.0 is now live.

@cribby You were looking for the changes to the walker for Bootstrap 2.3.2, is that correct?

SideQuestDIY commented 11 years ago

@Cribby I have updated the script for Bootstrap 2.3.2 but I haven't found an elegant way to add it to the repository so I created a Gist for you with the updated files - https://gist.github.com/twittem/6358588

ghost commented 11 years ago

Many thanks @twittem really appreciate it.

prionkor commented 11 years ago

Thanks for the gist. You could create a separate branch for the update for older bootstrap so anyone can download the branch if needed :) But gist works too..

prionkor commented 11 years ago

Important: Dropdown menu doesn't seem to work because of data-toggle and data-target attributes are missing. Fixed it you can see the working gist here https://gist.github.com/prionkor/6550191

All credit goes to @twittem

ghost commented 11 years ago

Cool, thanks @prionkor :)

SideQuestDIY commented 11 years ago

Hey @prionkor, thanks for the update. I rewrote the class based on my new class for 3.0 and didn't even realize there was an issue. I finaly got arround to creating a new branch of the repository for the version for 2.3.2 that can be found here https://github.com/twittem/wp-bootstrap-navwalker/tree/For-Bootstrap-2.3.2

If you fork it, then update the file with your changes and create a pull request I will merge it so you get contributor credit on the main repo.

prionkor commented 11 years ago

@twittem Thanks! I am new to git. I will try that.