Skip to content

saffa803/sage-bulma-navwalker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sage 9 friendly Bulma Navwalker

Sets up a Bulma Navwalker for Sage 9-based themes.

To install, run the following in your Sage9-based theme directory:

composer require "saffa803/sage-bulma-navwalker"

Include the navwalker in your wp_nav_menu function:

As a Controller method (Recommended)

In your Controller, probably app.php

/**
 * Primary Nav Menu arguments
 * @return array
 */
public function primarymenu() {
  $args = array(
    'theme_location'    => 'primary_navigation',
    ...
    'walker'            => new \App\wp_bulma_navwalker()
  );
  return $args;
}

In your Blade file, probably header.blade.php

@if (has_nav_menu('primary_navigation'))
  {!! wp_nav_menu($primarymenu) !!}
@endif

Without Controller

If you're not setting up your template data with Controller, you'll need to fully reference the \App\wp_bulma_navwalker(). In your Blade file, probably header.blade.php

@if (has_nav_menu('primary_navigation'))
  {!! wp_nav_menu(['theme_location' => 'primary_navigation', 'walker' => new \App\wp_bulma_navwalker()]) !!}
@endif

About

Sets up a Bulma Navwalker for Sage 9-based themes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages