Giter Site home page Giter Site logo

ivandoric / gatsby-wordpress Goto Github PK

View Code? Open in Web Editor NEW
93.0 93.0 45.0 506 KB

Repository for the tutorial series about creating websites using Gatsby.js and WordPress

Home Page: https://www.youtube.com/playlist?list=PLUBR53Dw-Ef8fe-8xJXtMpd1-uhgd2Qa6

License: MIT License

JavaScript 37.74% CSS 62.26%

gatsby-wordpress's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gatsby-wordpress's Issues

TypeError: can't access property "allWordpressPost", data is undefined

Hi,
I tried your tutorial on LIST-POST, but I get the following error: TypeError: can't access property "allWordpressPost", data is undefined

Here is my code:

import React, { Component } from "react"
import Link from "gatsby"
import PropTypes from "prop-types"

class Actualites extends Component {
	render() {
		const data = this.props.data

		return(
			<div>
				<h1>Posts</h1>

				{data.allWordpressPost.edges.map(({node}) => (
					<div key={node.slug} className={"post"} style={{ marginBottom: 50 }}>
						<Link to={'post/' + node.slug}>
							<h3>{node.title}</h3>
						</Link>

						<div className={"post-content"} dangerouslySetInnerHTML={{__html: node.excerpt}} />

						{node.date}
					</div>
				))}

			</div>
		)
	}
}

Actualites.propTypes = {
	data: PropTypes.object.isRequired,
	edges: PropTypes.array,
}

export default Actualites

export const pageQuery = graphql`
    query postsQuery{
        allWordpressPost{
            edges{
                node{
                    title
                    slug
                    date(formatString: "MMMM DD, YYYY")
                }
            }
        }
    }
`

custom post types

Hi there,

I do something like this in the component folder - I want to display few news on homepage, dedicated page with all news listing will be on the other page
component
homepage

Why it's not displaying on homepage?

Sidebars from WordPress?

Is there a way that you've found to pull in sidebar data into Gatsby? I've installed a WP REST API Sidebars but it doesn't pull in any of the widget's data. I also tried to pull in data with a custom GraphyQL query, but that didn't help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.