headless-cms

Custom field not saved

感情迁移 提交于 2021-01-29 07:34:45
问题 I try to add a custom user field to the user by using WPGraphQL. Therefore I tried to recreate the example in the official WPGraphQL documentation https://docs.wpgraphql.com/extending/fields/#register-fields-to-the-schema : add_action('graphql_init', function () { $hobbies = [ 'type' => ['list_of' => 'String'], 'description' => __('Custom field for user mutations', 'your-textdomain'), 'resolve' => function ($user) { $hobbies = get_user_meta($user->userId, 'hobbies', true); return !empty(

How to render all wordpress pages as a section in a single page gatsby site

不羁岁月 提交于 2019-12-13 09:55:46
问题 I am wanting to build a single page portfolio that is structured in sections like: intro projects CV contact I have a separate page for each of those sections created in wordpress. How can I render each wordpress page to one single page with gatsby? Here is where im creating gatsby pages from wordpress API: https://github.com/joeymorello/port-site/blob/master/gatsby-node.js 回答1: A very simple example might be adding something something like this to your pages/index.js : import React from