Menu links got trimmed (removed)
Themes created using the https://fullsiteediting.com/block-theme-generator/ are trimming the menu links. Looks like there are some limits are indirect trimming based on the length or so (But, unfortunately I couldn't yet figure it out). Strangely, when we switch to other themes like twentytwentytwo, all links are appearing in the menu.
I kinda figured it out:
You'll need something like below:
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"3rem","right":"3rem","bottom":"3rem","left":"3rem"}}},"layout":{"inherit":true}} -->
<div class="wp-block-group alignfull" style="padding-top:3rem;padding-right:3rem;padding-bottom:3rem;padding-left:3rem">
<!-- wp:group {"align":"full", "layout":{"type":"flex","justifyContent":"space-between"}} -->
<div class="wp-block-group alignfull">
<!-- wp:group {"layout":{"type":"flex"}} -->
<div class="wp-block-group">
<!-- wp:site-logo {"width":190,"shouldSyncIcon":true} /-->
<!-- wp:site-title {"className":"hidden","fontSize":"medium"} /-->
</div>
<!-- /wp:group -->
<!-- wp:navigation {"overlayBackgroundColor":"background","overlayTextColor":"foreground","style":{"typography":{"textDecoration":"underline"}}} -->
<!-- wp:page-list {"__unstableMaxPages":"6", "isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
<!-- /wp:navigation -->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->
This addresses
- Full width for the header (by default, it is missing for the second group)
- Hidden site title (not removed for accessibility)
__unstableMaxPagesalong withwp:page-list
Hi I did not understand what you meant with "trimming the links", can you share a screenshot? Which theme versions? They do not all use the same header files and the advanced version has two header template parts.
The pagelist should only be placed inside a navigation block in markup if it is intended to be used as the default, which is not the scenario in these example themes.
You need to set up your own menu on the sites, that is why the navigation block is empty in the markup.
I need to check again and will share more details. But, for a quick note/reply....
When the wp:navigation is empty, by default WordPress core is populating it with wp:page-list with __unstableMaxPages: 4 (4 is hardcoded and so other links are not visible)
Also, note that it addresses the full width issue (markup was wrong)
Hi, I am still struggling to understand which theme version you are working with, can you give me any more information so that I can try to reproduce the alignment issue?
The number of pages in the menu is arbitrary, - you will always need to adjust the menu for your website. -If I set the number to 6, then someone with 8 pages still wont see all their pages . And so on :)
@carolinan
I believe it is https://github.com/carolinan/fullsiteediting/blob/course/Starter%20themes/basic-60/parts/header.html#L11
Related core code https://github.com/WordPress/WordPress/blob/96c26acafd80a5da472e8bbbf41bf6a197ba8c6f/wp-includes/blocks/navigation.php#L316
So, when you install this theme.. without doing anything you'll find the menu (through fallback approach in the core code), but it will have only 4 items.
Correct, if you want a customized menu with more items you need to update it and add the items you want in the menu..
It seems to me that you didn't use the theme like I did (Just download and use). So, feel free to close the issue if required.