6 years, 1 toxic job, and a lot of mental health challenges later I’m back with a new blog post. I’ve been out of work for the past 2.5-3 years while recovering from an illness and I have not built any sites or coded much since I stopped working.
Since I got sick every time I’ve tried to do any sort of programming or web development I’ve just hit brick wall after brick wall. Every time I sit down to do something I feel like I’ve forgotten the little bit I did know and like I have no capacity to retain anything new. I end up getting frustrated and overwhelmed and I give up. I’ve tried getting back up to speed by working on my personal sites with no success until this past couple weeks.
It’s a small thing but putting together this walker is actually the first win I’ve had since getting ill. Since it’s a milestone in my recovery and something others might find useful I thought I’d post it on my blog. It seems like a good reintroduction and considering my last post was about a month after starting the toxic job that wrecked my mental health, I’d like this post to also signify me finally moving on from that bit of my past.
Anyway, this is a WordPress NavWalker intended to be used with the Soil plugin in a Sage 10 project. It extends the nice Soil walker and adds Bootstrap 5 classes. I hope it’s helpful to someone out there, and I hope to be posting here more frequently in the future.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header class="banner"> | |
@if (has_nav_menu('primary_navigation')) | |
<nav class="navbar navbar-expand-lg navbar-light bg-light" | |
aria-label="{{ wp_get_nav_menu_name('primary_navigation') }}"> | |
<div class="container"> | |
<a class="navbar-brand" href="{{ home_url('/') }}"> | |
{!! $siteName !!} | |
</a> | |
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-nav" | |
aria-controls="main-nav" aria-expanded="false" aria-label="Toggle navigation"> | |
<span class="navbar-toggler-icon"></span> | |
</button> | |
<div class="collapse navbar-collapse" id="main-nav"> | |
{!! wp_nav_menu([ | |
'theme_location' => 'primary_navigation', | |
'menu_class' => 'navbar-nav me-auto mb-2 mb-lg-0', | |
'walker' => new \App\BootstrapNav(), | |
]) !!} | |
</div> | |
</div> | |
</nav> | |
@endif | |
</header> |