You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to CRA and a React beginner.
I am planning to build a WordPress theme using React + Redux and the WP API. I will be using the Foxhound theme as a guide.
I currently have a WordPress website running on my local Windows 10 machine using Wampserver 3.0.8 (Apache 2.4.23, PHP 7.0.11, MySQL 5.7.15).
I am using an Apache virtual host and the WordPress website loads at mywebsite.dev
Does CRA support named URLs e.g. mywebsite.dev as opposed to localhost:3000?
The other question I have is: does anyone have any examples/tutorials of how to build only parts of a WordPress theme as a Single Page App instead of the entire website to get the full SEO benefits as discussed in this blog post?
SEO is a challenge for all websites built as a SPA.
@olivia101 for SEO i think you could do a user agent switching. It's similar to what prerender.io does. But instead of an external service you could feed the bots to wordpress' own theme engine. I'm building one myself currently.
Activity
gaearon commentedon Feb 12, 2017
I think you should be able to use
HOSTandPORTenvironment variables for this.See Advanced Configuration.
Does this help?
cr101 commentedon Feb 12, 2017
@gaearon Yes that helps. Thanks.
The other question I have is: does anyone have any examples/tutorials of how to build only parts of a WordPress theme as a Single Page App instead of the entire website to get the full SEO benefits as discussed in this blog post?
SEO is a challenge for all websites built as a SPA.
viankakrisna commentedon Feb 13, 2017
@olivia101 for SEO i think you could do a user agent switching. It's similar to what prerender.io does. But instead of an external service you could feed the bots to wordpress' own theme engine. I'm building one myself currently.
gaearon commentedon Feb 14, 2017
I’m going to close as this is not directly actionable in this repo, but feel free to continue the discussion!
viankakrisna commentedon Feb 14, 2017
for anyone who needs user agent switching for bots in WordPress / PHP:
put this in your theme's index.php
reference: https://gist.github.com/thoop/8165802 and https://prerender.io/documentation/install-middleware
cr101 commentedon Feb 15, 2017
@viankakrisna Thank you, I'll give that a go.