WordPress 101 - Part 14: Edit the menu with the Walker Class - Part 1

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ธ.ค. 2024

ความคิดเห็น • 163

  • @yaroslavnovichkov6736
    @yaroslavnovichkov6736 5 ปีที่แล้ว +1

    There're no such videos about Walker Classes in Russian. No one single good tutorial. You explain very good and speak clearly. Thanks a lot.

  • @KUBE.archvis
    @KUBE.archvis 2 ปีที่แล้ว +1

    This is the only lesson on the walker class that i was able to understand. Thanks for the explanations!

  • @danieldafoe1782
    @danieldafoe1782 8 ปีที่แล้ว +20

    Best resource on walker. Crystal clear. You surely have teaching skills! Thanks a lot !

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      +Daniel Dafoe Oh wow, thank you so much for this positive feedback :D

  • @dco_
    @dco_ 8 ปีที่แล้ว +14

    Hey guys, make sure to add the ? in the shorthand of the if statement for the $submenu variable. I think Alec had cut this out right around 26:30. Thanks for these awesome tutorials!

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      +Drew Cook thanks for flagging that out, I totally forgot but should be fixed in the git repo

  • @ndmytrakh
    @ndmytrakh 8 ปีที่แล้ว +1

    This is the best walker class tutorial I've ever seen. Thanks a lot Alessandro.

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      +Nazar Dmutrah Happy to hear that! It's actually 1 year old, and small things have changed, I should do an update tutorial about it.
      Happy Coding!

  • @reginaldromanbigornia11
    @reginaldromanbigornia11 8 ปีที่แล้ว +2

    The way you explain things is great! Thanks for the video!

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      +theNoob Thank you so much for watching!

  • @ammarhassan_
    @ammarhassan_ 7 ปีที่แล้ว +1

    This tutorial is amazing! ur explanation and step by step is pure genius. Thank you!

    • @alecaddd
      @alecaddd  7 ปีที่แล้ว

      Oh wow, thank you so much :D

  • @markwaters5964
    @markwaters5964 9 ปีที่แล้ว +1

    Great Stuff. You are explaining the Walker Class very well. This is very helpful!

    • @alecaddd
      @alecaddd  9 ปีที่แล้ว

      Thank you for the feedback, I still think that I could improve more.

    • @aurelianspodarec2629
      @aurelianspodarec2629 9 ปีที่แล้ว

      +Alessandro Castellani Theres always some space to improve :)

  • @wireinet
    @wireinet 3 ปีที่แล้ว

    Ease learn wordpress with your channel! Thanks!

  • @parkashsaini868
    @parkashsaini868 9 ปีที่แล้ว +1

    thank you for creating this helpful tutorial. Your way of explaining is very good.

  • @sudani1969
    @sudani1969 ปีที่แล้ว

    Great tutorial now I'm trying to convert bootstrap 5 menu into wp_na_menu, but I'm facing 2 issue so far as I have a div before the UL and struggling to add the bootstrap classes to wp_na_menu any direction on how to do the conversion, thanks in advance

  • @infodrop
    @infodrop 2 ปีที่แล้ว

    Cool description man. THanks a lot.

  • @davidkahdze3474
    @davidkahdze3474 4 ปีที่แล้ว

    you are the most good teacher man!!!!!! thank you very much

  • @zahirabs1
    @zahirabs1 6 ปีที่แล้ว +2

    You are the best of the best ... thumbs up!

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      Thank you so much

  • @duncankostello8596
    @duncankostello8596 7 ปีที่แล้ว +1

    thanks Alex great series of tutorials

    • @alecaddd
      @alecaddd  7 ปีที่แล้ว

      Thank you so much

  • @andreascarpa7143
    @andreascarpa7143 5 ปีที่แล้ว +2

    Hi Alex, thanks a lot for you lessons; they're so valuable but, as many other, I'm facing the issue "Declaration of Walker_Nav_Primary::start_lvl(&$output, $depth) should be compatible..." According to your suggestion, I've checked the repo in github but unfortunately it didn't do the trick. Here the fragment I've found over there: "function start_lvl( &$output, $depth ){ //ul..." which doesn't work; following some suggestion in the chat I've replaced that line with this one : function start_lvl( &$output, $depth=0, $args=array()): in this case, I got no errors but the menu has disappeared. Can you kindly give any clue?

    • @Daaboo
      @Daaboo ปีที่แล้ว

      same for me in 2023. any clue?

  • @architchandra
    @architchandra 6 ปีที่แล้ว +1

    Just a small piece of feedback - please keep your cursor in the middle of the recording screen (vertically) otherwise those of us watching with subtitles on are not able to see what you are writing (eg around 7:57, when you are including the Walker.php file). Thanks. Keep up the good work. :)

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว +1

      Thanks for the feedback, didn't think about that. Cheers

  • @Project308
    @Project308 3 ปีที่แล้ว

    The coolest thing I've learned is the
    $var = (condition) ? [ true clause ] : [ false clause ];
    it looks so neat.
    Also: thank you so much for the tutorial!

  • @citylumberjack8381
    @citylumberjack8381 3 ปีที่แล้ว

    This is a great tutorial on walker classes as there really isn't much info even now in 2021 regarding this HTML tree manipulation, at least not on youtube. I followed both of your tutorials on this topic - this video (part 14) and also part 15 and it works great after I inspect the elements -no critical errors.
    However, I was wondering how to add an "ID" instead of a "Class" to different submenus elements so that I might use javascript later on to create a better mobile nav UX. So for example, adding an ID of dropdown-menu so it renders like the following:

  • @eMebyMonicaMateu
    @eMebyMonicaMateu 2 ปีที่แล้ว

    Hi; probably it's because after years things have changed, but for me it does not work.. If I inspect the code, the submenu is there, and I can see the caret, but if I click I just open the first level.. and I can no see the second ones opened. I am using Bootstrap 5; is it enought changing data-toggle="dropdown" to data-bs-toggle="dropdown" ?

  • @mohammadumar443
    @mohammadumar443 5 ปีที่แล้ว

    if you want data- attributes to and and each data- attribute would be different to each different and what would be the solution?

    • @alecaddd
      @alecaddd  5 ปีที่แล้ว

      Check my playlist on how to create a Mega Menu in WordPress. I explain how to tweak everything in details

  • @DimitrisHD
    @DimitrisHD 6 ปีที่แล้ว +2

    No words, you rock . Thats all!

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      Ahahah, thank you :D

  • @JayJay-ki4mi
    @JayJay-ki4mi 4 ปีที่แล้ว +1

    The indentation part isn't really required because dev tools on all browsers will auto indent. It all gets uglified once in production anyway. Other than that great tutorial :)

  • @yassinyoussoufali6324
    @yassinyoussoufali6324 8 ปีที่แล้ว

    Love you bro :)
    i am confused about widgets.. can we use the walkers to customize its output? thx again

  • @tedamaradidis3265
    @tedamaradidis3265 3 ปีที่แล้ว

    I did a menu and it works perfectly fine in all devices except Android! Any advice is greatly appreciated!

  • @codeAlongwith
    @codeAlongwith 6 ปีที่แล้ว +2

    so I got this error:
    Warning: Declaration of Walker_Nav_Primary::start_lvl() should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth)
    I changed it to:
    Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) and seemed to fix it.....is this right?

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      Yes, correct. WordPress now requires default values for all the attributes of the Walker Nav Class.
      I pushed an updated code on my GitHub repo.

    • @guticide
      @guticide 6 ปีที่แล้ว +1

      Hello, I am from HK, a newbie developer...
      I used Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) , and it shown error,
      and I use Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array() ) it seems works, or is it a wrong declaration?
      Thanks

    • @mannydev9203
      @mannydev9203 6 ปีที่แล้ว

      I've looked into the repo and I can't see that update...

    • @benoitmatterne509
      @benoitmatterne509 6 ปีที่แล้ว

      Same issue :(
      I find this on github github.com/wp-bootstrap/wp-bootstrap-navwalker/tree/v3-branch, and it works very well .
      You can find similar class for Boostrap 4 ;)
      You can also use the walker.php that Alessandro used in "Create a Premium Theme" tutorial chapter 18. You can find this class in the git repo github.com/Alecaddd/Sunset-theme

  • @AkidsukiGangstaCat
    @AkidsukiGangstaCat 8 ปีที่แล้ว +1

    Hi. Alex. Thank you very much for the video. I see a search icon next to the menu. In which video did you insert it? :D

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว +2

      Hi, I implemented a couple of extra things during the live development sessions. You can check those videos in the playlist.
      Cheers

    • @AkidsukiGangstaCat
      @AkidsukiGangstaCat 8 ปีที่แล้ว

      Ok. I will. Thanks. :D

    • @andoy_abarquez
      @andoy_abarquez 8 ปีที่แล้ว

      is it on Part 3?

    • @raulterraferrao696
      @raulterraferrao696 8 ปีที่แล้ว

      Yes, it is on part 3 of live development session

  • @violabee918
    @violabee918 8 ปีที่แล้ว +1

    Thanks so much for this very helpful series! I seem to have a slight problem and was hoping you could help. As soon as I started integrating the walker class, my carousel broke! :( I did read through the comments and see that you had updated the git repo ... any thoughts?

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      WordPress updated a bit the Walker Class since I did this tutorial, so there are some small changes that affect the theme a bit, but nothing major.
      I suggest you to check the walker class in my Git repo in the last lesson folder, that is the most updated and working one.
      Let me know if you fixed it.

    • @violabee918
      @violabee918 8 ปีที่แล้ว

      I have already checked that but still no luck. I'm not giving up yet!

  • @helmikrisnadi
    @helmikrisnadi 8 ปีที่แล้ว +1

    Hi Alessandro, thank you for your tutorial, it's really helpful. I want to ask you, since i'm a newbie on wordpress, why the pagination not working when I set the page template as a static front page? It just leave the page blank. I'd be very glad if you can tell me how to fix this. Thank you :)

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      If you set a static front page you lose the default blog loop that prints your posts. Your theme is now returning only the info of 1 single page, the one that you set. The pagination works in the blog page, search result or archive page.

    • @helmikrisnadi
      @helmikrisnadi 8 ปีที่แล้ว

      Thank you for your explanation, i think i've got it. I should learn more about hierarchical of wordpress.

  • @pushpendumondal2737
    @pushpendumondal2737 9 ปีที่แล้ว +1

    Thanks.. It help me sort couple of my issues.

    • @alecaddd
      @alecaddd  9 ปีที่แล้ว

      +pushpendu mondal Glad I was helpful. Thank you for following.

  • @ruipeng1624
    @ruipeng1624 4 ปีที่แล้ว

    If you start the tutorial from the display_element() method followed by the start_el() method of the Walker_Nav_Menu class , you can let the viewers code along and check how classes and attributes modify the final ouptut step by step.

  • @bkvishalkunwar
    @bkvishalkunwar 5 ปีที่แล้ว

    Hi sir i need one help, using walker i want to add div html tag on third ul under tag only one time, no repeatation. Please sir i need help

    • @alecaddd
      @alecaddd  5 ปีที่แล้ว

      Check my playlist about WordPress mega menu to learn everything you need

  • @KaylaTeets
    @KaylaTeets 8 ปีที่แล้ว +1

    Since the Walker code isn't working, I'm just going to keep all of this code as "comments" and if you make an updated version of this video then I can refer back to the code. For now I'll move onto the next lesson. Thanks for your hard work. ^_^ For anyone else stuck on this make sure you adjust the header, functions, and walker files.

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      +Kyrae Jenkins Why is not working?
      What problem are you encountering?
      Did you check my source code on GitHub? Let me know, I'm sorry if you're having issues

    • @KaylaTeets
      @KaylaTeets 8 ปีที่แล้ว

      +Alessandro Castellani my code tells me that on line 31 there is a sub-menu syntax error. and I noticed other people had the same issue. and you said that since this tutorial there was an update and that you would do a new video in the future so I figured I would skip this lesson until then. does the source code on github have the updated code?

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว +1

      Let me grab that for you

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว +2

      +Kyrae Jenkins Here: github.com/Alecaddd/WordPress101/blob/master/lesson_22/inc/walker.php

    • @jeggersaren7638
      @jeggersaren7638 8 ปีที่แล้ว +2

      Hi +kyrae Jenkins! When you said that you were stuck in this project do you this kind of error?
      Strict Standards: Declaration of Walker_Nav_Primary::start_lvl() should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) ??
      If yes, then you should edit your wp_config.php file and set your 'WP_DEBUG' into false such as this define('WP_DEBUG', false);
      That is how I fixed my error. in this tutorial :)

  • @BoykoDev
    @BoykoDev 8 ปีที่แล้ว

    Great tutorial, as always!
    You can also include template with "include(locate_template('path/to/template.php'));"

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      +Serge Boyko Sure, you can use also include, but I won't recommend it.
      First you're using 2 functions ( include and locate template ), instead of only 1 (get_template_part).
      And second, get_template_part is part of the default API of WordPress and it's highly recommended to use that one during theme development.
      Happy coding!

    • @BoykoDev
      @BoykoDev 8 ปีที่แล้ว +1

      +Alessandro Castellani Didn't think about it like that. Thanks for explanation!

  • @zaidiftikhar9938
    @zaidiftikhar9938 8 ปีที่แล้ว +1

    thank you so much its very helpfull ,but i have problem my code how can i fix it
    Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'new description_walker()' not found in F:\php\htdocs\wordpress\wp-includes
    av-menu-template.php on line 706...

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      Hi, this looks not related to the custom theme, but it's an error of your WordPress installation.
      Be sure you installed WP correctly.

    • @zaidiftikhar9938
      @zaidiftikhar9938 8 ปีที่แล้ว

      I again installed it solve this,but i have generated one depth and one submenus ,it will not give another submenus ..how can i solve this..

  • @asleeinarhansen3596
    @asleeinarhansen3596 7 ปีที่แล้ว +2

    For anyone having a problem with the menu not showing up after doing this lesson just change the function start_lvl(&$output, $depth) to function start_lvl(&$output, $depth = 0, $args = array()) and comment out function start_el().

    • @sebastiaanram9919
      @sebastiaanram9919 7 ปีที่แล้ว

      Awesome, thanks!

    • @faysalanonna
      @faysalanonna 2 ปีที่แล้ว +1

      Thank you, it works. But why does the problem occurs !?

  • @vandanaraogck3122
    @vandanaraogck3122 6 ปีที่แล้ว

    Hi,i have a doubt,i have 4 menus,in that about.php,courses.php,gallery.php.please tell me how to use conditional statements inside the page.php,thanks in advance

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      I'm not sure I got your question. So, you have 4 menus, I guess you want to show them dynamically based on the page, right?
      If that's the case, just assign each of those menus to a different menu location, and then call that menu location in the relative PHP file.

    • @vandanaraogck3122
      @vandanaraogck3122 6 ปีที่แล้ว

      Alessandro Castellani yaa exactly like that only, can u please give me some hints to do that

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      I explained that in this series if I'm not wrong. Showing how to create a menu with a unique location, and then call that location on a specific page.

  • @sororbudwiser
    @sororbudwiser 4 ปีที่แล้ว

    Is this still valid for use in 2020?

  • @rizwanshaikh8209
    @rizwanshaikh8209 4 ปีที่แล้ว

    Great tutorial thanks sir

    • @alecaddd
      @alecaddd  4 ปีที่แล้ว

      You are welcome

  • @KhalilCh
    @KhalilCh 8 ปีที่แล้ว

    Hi Alessandro, I noticed that the search is been changed to icon on the right from part 13 to part 14, is there is a missing part? Thank you

    • @paolo-1283
      @paolo-1283 8 ปีที่แล้ว

      watch the live sessions playlist, it's in part 3 i think.

    • @KhalilCh
      @KhalilCh 8 ปีที่แล้ว

      Thanks, I got it

  • @JarlHelin
    @JarlHelin 8 ปีที่แล้ว +1

    Bravo! Worked a charm!!

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      Happy to hear that :D

  • @joanamayamores7221
    @joanamayamores7221 5 ปีที่แล้ว +1

    Hi, the $submenu = ($depth > 0) ' sub-menu' : ' '; didn't work on mine. :(

    • @tomdevisser8150
      @tomdevisser8150 3 ปีที่แล้ว

      You need ? before ' sub-menu', it's a ternary operator.

  • @policeuac
    @policeuac 7 ปีที่แล้ว

    I have wp-bootstrap-navwalker.php in my root folder but i think we can't style navwalker with that way right? Do i need wp-bootstrap-navwalker.php?

    • @alecaddd
      @alecaddd  7 ปีที่แล้ว

      Mhhh, sorry, I don't think I get your issue.
      You have a walker nav class, did you require that file in the functions.php?
      Are you calling that class when invoking the wp_nav_menu?

    • @policeuac
      @policeuac 7 ปีที่แล้ว

      My walkernav menu working without any issue so i dont style it yet. I mean i dont see wp-bootstrap-navwalker.php in your root directory. Do i need it when styling with your technique?

  • @syyhkyrotta
    @syyhkyrotta 8 ปีที่แล้ว

    THANK YOU ONCE AGAIN FOR GREAT CONTENT! :D

  • @poorvijain7281
    @poorvijain7281 6 ปีที่แล้ว

    dear when i am adding this walker class in header.php , my menu items disappered. Please suggest.

    • @poorvijain7281
      @poorvijain7281 6 ปีที่แล้ว

      Dear query is resolved i checked code on github. Thanks

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      Cheers

  • @suyashdasani
    @suyashdasani 7 ปีที่แล้ว

    hii
    Alessandro Castellani in my code i am using this code its not showing any error but it's hiding my menu
    function start_lvl(&$output, $depth = 0 ,$args =array() ) {
    $indent = str_repeat("\t",$depth);
    $submenu = ($depth > 0)? 'sub-menu' : '';
    $output .= "
    $indent
    ";

    • @alecaddd
      @alecaddd  7 ปีที่แล้ว

      No need to write the same issue in multiple social media. Just writ a comment in a place and wait for the answer.
      I answered to you on my facebook page already.

  • @manishdhiman2005
    @manishdhiman2005 6 ปีที่แล้ว

    how can i fix this- ( ! ) Parse error: syntax error, unexpected ''walker'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in C:\wamp64\www\wordpress\wp-content\themes\awesometheme\header.php on line 53

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      Check my source code on GitHub, you most likely have a syntax error.

    • @manishdhiman2005
      @manishdhiman2005 6 ปีที่แล้ว

      not working, same code, it shows ( ! ) Parse error: syntax error, unexpected ''walker'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' and dreamweaver show error in line- 'walker' => new Walker_Nav_Primary()

    • @manishdhiman2005
      @manishdhiman2005 6 ปีที่แล้ว

      not be able to solve

  • @sufiansuhail9243
    @sufiansuhail9243 3 ปีที่แล้ว

    Thank you very much

  • @joselop4071
    @joselop4071 7 ปีที่แล้ว

    I wish you could tell me how the value of $depth is detected. That is what you say in the video. The value is detected. But how?

    • @alecaddd
      @alecaddd  7 ปีที่แล้ว

      It's a built-in method of WordPress.
      The $depth variable represents the location of a link inside your menu. If the link is at the first position, so it's not indented to anything and doesn't have any parent, his depth is 0.
      If an element is a child, the depth is 1
      If an element is a child of a child, the depth is 2.
      And so on.
      WordPress automatically detects your menu structure and applies an incremental number ($depth) to your elements based on their location.

    • @joselop4071
      @joselop4071 7 ปีที่แล้ว

      Many thanks Ale. You know, despite Wordpress being so so old, many fundamental parts of the documentation are a piece of sh**

  • @glgeorgiou
    @glgeorgiou 6 ปีที่แล้ว

    Great tutorial but. In current WordPress version, 4.9.8, seems that functionality is broken by few core WordPress files.

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว +1

      Check my source code on GitHub, I updated those few spots in the Walker Nav Class to work with the recent version of WordPress. You just need to add defaults to methods' attributes

  • @georgioamista6043
    @georgioamista6043 3 ปีที่แล้ว

    Thank you

  • @dwaynetaustin
    @dwaynetaustin 6 ปีที่แล้ว

    anyone having issues with the "require" part in the functions php file, i keep getting errors on this part

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      What errors are you getting?
      did you check my source code on GitHub?

    • @dwaynetaustin
      @dwaynetaustin 6 ปีที่แล้ว +1

      i got it working, apparently i accidently created the file into another file.....but now im having another issue
      Declaration of Walker_Nav_Primary::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array)
      im also checking your source code for mistakes i might did

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      That's a recent depreciation of the new version of WordPress for the walker nav class.
      Simply update the attributes of the start_lvl method how suggested in the error.
      start_lvl(&$output, $depth = 0, $args = Array)

  • @mihajloilic5836
    @mihajloilic5836 3 ปีที่แล้ว

    I hope this isn't requiring to have in building your custom theme? :)

  • @ukamakaanagboso6021
    @ukamakaanagboso6021 6 ปีที่แล้ว

    Hi Alex, thanks for a great video. I'm totally a newbie with no training or experience whatsoever, I'm learning WordPress for my own use only. Your series has been of a great assistance to me. However, I'm stuck. I'm receiving the error below, which I can't figure out how to solve it, I would appreciate if you could figure out for me what to do.
    Pls, note that I have removed the comments for more clarity.
    Thank you in advance.
    UA
    Error 1:
    Warning: Declaration of Walker_Nav_Primary::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in C:\xampp\htdocs\wordpress\wp-content\themes\learningtheme\inc\walker.php on line 16
    Error2:
    Warning: Declaration of Walker_Nav_Primary::start_el() should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in C:\xampp\htdocs\wordpress\wp-content\themes\learningtheme\inc\walker.php on line 16
    Code:

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      That's a recent depreciation of the new version of WordPress for the walker nav class.
      Simply update the attributes of the start_lvl method how suggested in the error.
      start_lvl(&$output, $depth = 0, $args = Array)

  • @paulmiller8128
    @paulmiller8128 6 ปีที่แล้ว

    Hi Alessandro,
    Sorry, but back again.
    I've followed your lesson (and understood most of it!) but have ended up with a couple of error messages:
    "Warning: Declaration of Walker_Nav_Primary::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in C:\xampp\apps\wordpress\htdocs\wp-content\themes\Paulsfirst\inc\walker.php on line 49"
    "Warning: Declaration of Walker_Nav_Primary::start_el() should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in C:\xampp\apps\wordpress\htdocs\wp-content\themes\Paulsfirst\inc\walker.php on line 49"
    Line 49 is just the closing } (and I copied the code for walker.php from github to make sure it wasn't my typing) - Help please.
    Many thanks
    PS Your tutorials are great btw.

    • @paulmiller8128
      @paulmiller8128 6 ปีที่แล้ว +1

      Cracked it - I found your link to the corrected code in one of the replies below:
      github.com/Alecaddd/WordPress101/blob/master/lesson_22/inc/walker.php
      Onwards & upwards

    • @alecaddd
      @alecaddd  6 ปีที่แล้ว

      Ah, yes, the Walker Nav Class was slightly updated since the release of this video. Thanks for watching, and Happy Coding!

  • @Архив-в3ц
    @Архив-в3ц ปีที่แล้ว

    26:34

  • @mohammadhuzaifa298
    @mohammadhuzaifa298 8 ปีที่แล้ว +2

    Hey Alessandro, to be honest your tutorials is very good im loving it!
    But my wp_reset_postdata(); is not working, kindly help me out and one more thing you are my wordpress teacher and my this teacher is awesome
    Love from Pakistan
    :)

    • @alecaddd
      @alecaddd  8 ปีที่แล้ว

      +Mohammad Huzaifa Hi man, thank you so much for your positive comment, I'm really happy to hear that.
      What is not working with the wp_reset_postdata()? Is your WP_Query not reverting to its original status?
      Thanks for watching.

  • @nerchit4475
    @nerchit4475 5 ปีที่แล้ว

    hey brother i think you need to update the video.

  • @lunaticochats
    @lunaticochats 2 ปีที่แล้ว

    And this how I use it with Tailwind CSS

  • @darrenforster99
    @darrenforster99 5 ปีที่แล้ว

    Thanks for this - although I have to admit this seems like a lot of work just to remove stupid little classes that are attached to the wordpress menus - it annoys me with all these CMS's when they put their own classes into things and you're like why don't you just produce raw html and allow the end developer to add their own classes on each block without having to go into PHP just to remove classes!

    • @alecaddd
      @alecaddd  5 ปีที่แล้ว

      Welcome to the convoluted world of the Walker Nav Class :P

  • @joselop4071
    @joselop4071 7 ปีที่แล้ว

    What is the real value of $depth in this menu? Where is the value assigned? Its a pity there is a gap in the explanation. Good job overall, though.

    • @alecaddd
      @alecaddd  7 ปีที่แล้ว

      The default value is 0.
      If you want to check the current value based on the menu item location, simply add it to the output of the start_el method:
      $output .= $depth;

    • @joselop4071
      @joselop4071 7 ปีที่แล้ว

      thanks, Alessandro. If the value is 0, I don't understand why. I have been looking through many tutorials and no many details are given. Your tutorial is the best I have found. But I still dont understand it all. Sometimes I think if it is really worth the effort to build a dynamic menu with PHP or just stick with a static one.

  • @mustaphabrahimi2449
    @mustaphabrahimi2449 7 ปีที่แล้ว

    that's not work

  • @mrv3173
    @mrv3173 3 ปีที่แล้ว

    holy shit... that's a lot of code for just outputting one single navigation bar... -_-