WordPress.org

Forums

DevDmBootstrap3
[resolved] Adding a container Div around dropdown menu (8 posts)

  1. Chris-Kay
    Member
    Posted 1 year ago #

    First of thanks for the template. It's a great clean template to start building on.

    I would like to add a container div around the Dropdown menu ul so I can stretch it to full page width.

    I figured in wp_bootstrap_navwalker.php by changing line 24
    $output .= "\n$indent<ul role=\"menu\" class=\" dropdown-menu\">\n";
    to
    $output .= "\n$indent<div class=\"dropdown-container\">\n$indent<ul role=\"menu\" class=\" dropdown-menu\">\n";

    It works but the dropdown-container div is not getting closed off. I can't figure out the code where you close the html tags since the ul and li are getting closed. I have limited knowledge of PHP so your assistance would be much appreciated.

    Thanks in advance.

  2. DevDm
    Member
    Theme Author

    Posted 1 year ago #

    Hey Chris,

    I think you went the hard way on that one.

    You want the navbar below the header to span the length of the page? Do I have that right?

  3. Chris-Kay
    Member
    Posted 1 year ago #

    Hey DevDM,

    Thanks for getting back to me so quick. To answer your question no, not really.

    I have the main nav in a Container. I want the dropdown background to span the full width of the page (outside the parent nav container) with the dropdown ul as a container so it get centered. Only way to achieve that is to put a wrapping container around the dropdown ul and the have the ul with margin: 0 auto center within. Hence my necessity to add a wrapping container div and then have it close again after the dropdown ul tag is closed.

    Hope you understand.

  4. Chris-Kay
    Member
    Posted 1 year ago #

    Sry double post

  5. DevDm
    Member
    Theme Author

    Posted 1 year ago #

    I see what you are after here and honestly I've not encountered this request before so it is new on me.

    I'm digging into the nav-walker to see if I can get you a solution but I'm out of time for today.

    Here is a link to the github project. The author is a really cool guy and could probably answer this quickly for you.

    https://github.com/twittem/wp-bootstrap-navwalker

  6. Chris-Kay
    Member
    Posted 1 year ago #

    Ok thanks, will take a look.

  7. DevDm
    Member
    Theme Author

    Posted 1 year ago #

    Let me know what you come up with :) I'll be curious.

  8. DevDm
    Member
    Theme Author

    Posted 1 year ago #

    Closed.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.