Skip to content

What is the Understrap way to add .dropdown-menu-end class to far right menu so dropdown doesn't go off the page? #2146

Answered by IanDelMar
currentcreative asked this question in Q&A
Discussion options

You must be logged in to vote

For a PHP solution you would have to adjust the nav walker like so:

// inc/class-wp-bootstrap-navwalker.php

class Understrap_WP_Bootstrap_Navwalker extends Walker_Nav_Menu {

	const DROPDOWN_MENU_CLASSES = array(
		'dropdown-menu-end',
		'dropdown-menu-start',
		'dropdown-menu-right',
		'dropdown-menu-left',
		'dropdown-menu-sm-end',
		'dropdown-menu-sm-start',
		'dropdown-menu-sm-right',
		'dropdown-menu-sm-left',
		'dropdown-menu-md-end',
		'dropdown-menu-md-start',
		'dropdown-menu-md-right',
		'dropdown-menu-md-left',
		'dropdown-menu-lg-end',
		'dropdown-menu-lg-start',
		'dropdown-menu-lg-right',
		'dropdown-menu-lg-left',
		'dropdown-menu-xl-end',
		'dropdown-menu-xl-start',
		'dr…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@currentcreative
Comment options

Answer selected by currentcreative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants