admin管理员组文章数量:1328026
I'm setting up a Wordpress project with Gatsby as frontend, and also using ACF for content. But I wonder how you would setup global content parts like header, footer, or any other kind of content that is being used globally throughout the website? For example both HOME and ABOUT pages need to have their "own" content, but also shares some specific blocks with same content.
I need to be able to edit the content for my header like setting up links to internal pages, be able to edit footer content (like text, an image etc), and for any other global blocks I'm looking for a way to setup them like title, text, maybe an image and so on (ACF control kind of...)
Please help me out!
Thanks
I'm setting up a Wordpress project with Gatsby as frontend, and also using ACF for content. But I wonder how you would setup global content parts like header, footer, or any other kind of content that is being used globally throughout the website? For example both HOME and ABOUT pages need to have their "own" content, but also shares some specific blocks with same content.
I need to be able to edit the content for my header like setting up links to internal pages, be able to edit footer content (like text, an image etc), and for any other global blocks I'm looking for a way to setup them like title, text, maybe an image and so on (ACF control kind of...)
Please help me out!
Thanks
Share Improve this question edited Jul 24, 2020 at 12:14 mozboz 2,6281 gold badge12 silver badges23 bronze badges asked Jul 24, 2020 at 6:03 nickelmannickelman 1032 bronze badges 6- 1 If your front end is being built with Gatsby, then this is more of a Gatsby question. Header links are typically navigation menus, and other content could be managed with the Customize API, but how you use those things in Gatsby is entirely a Gatsby question, which is off topic here. You'd be better off asking in a Gatsby specific forum. – Jacob Peattie Commented Jul 24, 2020 at 6:54
- Thanks @JacobPeattie. But in order to edit content of a "navigation menu", how do I do that? As I remember menues just allow you to choose what pages/urls the menu should have, and their labels? About Gatsby: Yes, in order to do the layout etc it's a Gatsby question, but the content is within Wordpress and I need to be able to fetch all my data via wp-json and that is based on how it is setup within Wordpress. Gatsby will only care for the data it fetches. – nickelman Commented Jul 24, 2020 at 7:02
- Menus are edited in Apperance > Menus. It will only appear if your theme supports menus. Which theme you use or how you use it when using Gatsby is, again, a Gatsby question. – Jacob Peattie Commented Jul 24, 2020 at 7:18
- @JacobPeattie yes, but where do I put an editable text (other than regular menu items) that needs to be in the menu? – nickelman Commented Jul 24, 2020 at 7:32
- That's not supported. You'd need to use the Customize API, as I suggested in my first comment. – Jacob Peattie Commented Jul 24, 2020 at 7:34
1 Answer
Reset to default 1ACF has the ability to create a 'Theme Options' page which you can then use to conveniently centralise options for things like headers and footer etc..
ACF Options Page information
As Jacob Peattie rightly points out, how you integrate this into Gatsby is outside of the scope of WPSE and may require custom development. However, providing you can inject custom code into these areas, via a function, shortcode or custom widget etc., using an ACF Options Page to control that content works nicely and is worth exploring.
本文标签:
版权声明:本文标题:plugins - How do I make reusable content blocks for header and footer when using Wordpress headless with another front-end? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742235979a2438088.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论