PHP code example of linkslegend / sage-megamenu
1. Go to this page and download the library: Download linkslegend/sage-megamenu library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
linkslegend / sage-megamenu example snippets
/**
* Primary Nav Menu arguments
* @return array
*/
public function primarymenu() {
$args = array(
'theme_location' => 'primary_navigation',
...
'walker' => new \App\wp_bootstrap4_navwalker()
);
return $args;
}
@if (has_nav_menu('primary_navigation'))
{!! wp_nav_menu($primarymenu) !!}
@endif
@if (has_nav_menu('primary_navigation'))
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'walker' => new \App\wp_bootstrap4_navwalker()]) !!}
@endif