#33974 closed defect (bug) (fixed)
Theme preview breaks HTML code in theme menu
Reported by: | progmastery | Owned by: | obenland |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | ui, template | Cc: |
Description (last modified by )
Theme preview modifies HTML code of navigation menu in some themes.
Here is an example:
https://wordpress.org/themes/best-magazine/
https://wp-themes.com/best-magazine/
This is how it should be
http://themedemo.web-dorado.com/bestmagazine/
nav menu call parameters:
wp_nav_menu( array( 'show_home' => true, 'theme_location' => 'primary-menu', 'container' => false, 'container_class' => '', 'container_id' => '', 'menu_class' => 'top-nav-list', 'menu_id' => '', 'echo' => false, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="top-nav-list" class=" %2$s">%3$s</ul>', 'depth' => 0, 'walker' => '' ));
It seems there is some problem with wrapping menu, but I don't know if this is site issue or something related with WordPress version (ver=4.4-alpha-34443). Therefore I submitted this ticket here , not in w.org meta.
Attachments (1)
Change History (8)
#3
@
9 years ago
- Component changed from General to Posts, Post Types
- Keywords has-patch added
- Milestone changed from Awaiting Review to 4.4
- Owner set to obenland
- Status changed from new to accepted
wp_page_menu()
doesn't have the option to omit a container. 33974.diff will add a fallback.
This ticket was mentioned in Slack in #themereview by jcastaneda. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by ocean90. View the logs.
9 years ago
Note: See
TracTickets for help on using
tickets.
Same problem here, with 4.4-alpha-34884
I verified the problem only occurs when you have 'container' => false in wp_nav_menu() and there's no menu assigned to that location (i.e., menu is generated automatically by WP). It then adds a blank tag (the container, that shouldn't be added) which breaks the layout.
Edit: I believe the problem is not related to theme preview (customizer), because it happens in the actual rendering of the site as well.