rtCamp / wp-decoupled

Next.js app with WPGraphQL and WordPress at the backend.
wp-decoupled-git-master.rtcamp.vercel.app
MIT License
264 stars 38 forks source link

Use Menu Queries to dynamically fetch WordPress Menus #38

Open imranhsayed opened 3 years ago

imranhsayed commented 3 years ago
NicestRudeGuy commented 3 years ago

@imranhsayed here do you mean the header and footer menus right ? for that do we need hcms plugin ?

imranhsayed commented 3 years ago

I suggest we create our own plugin and add that as a dependency. That plugin has too many things that not required for this project.

NicestRudeGuy commented 3 years ago

@imranhsayed now we can fetch the menus without any plugin , just did some experiment and we are getting the menus

imranhsayed commented 3 years ago

You can get the menus but the menu needs to be registered in WordPress. The user might register any menu and then expect the frontend to work. To rule out this issue we can create our own plugin and put in README to ask the user to created and add our menus only.

NicestRudeGuy commented 3 years ago

but we can have him name the menus like HEADER_MENU and FOOTER_MENU . this way we wont have another plugin to manage right ?

imranhsayed commented 3 years ago

We can register the menus into our theme https://github.com/rtCamp/wp-decoupled/issues/58

imranhsayed commented 3 years ago

@NicestRudeGuy Now that we are using the storefront theme Please use the menu location name that storefront theme uses.