DEV Community

phanatuan
phanatuan

Posted on

Problems with Gatsby & WordPress

I am a self-taught coder, and I am in the process of porting my shared-hosted Wordpress to Gatsby (hosted on Netlify).

I make the basic works (displaying the post and pages onto Netlify). However, I have some following concerns:

For page and post content, the data returns is html format. It was displayed in React as

<div dangerouslySetInnerHTML={{__html: wordpressPost.content}} />

The problems arise are:

  • How could I add custom format for the Wordpress content (the p, h1, ...)
  • How could I add the email newsletter form (maybe at 50% of the content, or after the 3rd paragraph)
  • How could I use the Gatsby Link component for <a> tag that points to the site (internal URL)
  • How to add advertisement code block across the content

...

I would really appreciate if someone could shed light on these matters. I really love the Gatsby look and feel, but these issues are holding me back.

Thanks,
Tuan.

Top comments (0)