• I am currently starting with my first custom block theme and I wanted to know if it’s possible to include Bootstrap without using a plugin. Additionally, I am interested in building a mega menu and modifying the breakpoints in my menu, in case I would like to have a different version for tablet view. Unfortunately, I haven’t found much or any information about this, so I would be grateful for any tips.

    Thank you in advance!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You can certainly have your theme enqueue the Bootstrap resources just as a plugin might do. If you intend to host your theme in the WP repository, loading external resources may or may not comply with the guidelines, IDK. You can get clarification direct from the theme review team through their #themereview Slack channel.

    The wp_nav_menu() function used to generate menu HTML output has several hooks you can use to alter the final output. For example, the ‘wp_nav_menu_objects’ filter could be used to add or remove menu item objects before the related HTML is generated. There are other hooks (such as ‘wp_nav_menu’) that will let you modify the HTML instead, if that works better for you.

    Thread Starter lisamaria12

    (@lisamaria12)

    I’m a complete beginner. Would it be possible to show me some code examples?

    Moderator bcworkz

    (@bcworkz)

    There’s an example at the bottom of the filter’s doc page. Adjust the logic to suit your need.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using Bootstrap and mega menu in my block theme’ is closed to new replies.