I’m developing a simple website that will use vuejs for the front end and wordpress to create dynamic contents. I have copied wordpress inside the public
folder of my vue project inside a directory named app
.I want to configure it to not use themes and to redirect each user that will open the app folder to the login page. I’m not a wordpress developer so I’ve done some researches and I’ve found the constant WP_USE_THEMES
. It’s not clear for me how it works, if I set it to false if I’ve understand, wordpress will not load and use themes right? If I follow this way, I will be able to use the REST api?How I will redirect users to login when they reach the app folder?
2
Answers
You’re still going to need an HTML template with a mount point for the app, so it’d probably be easier just to create your own theme specifically for this and then just have the one index.php file in the theme directory.
Per my understanding the WP_USE_THEMES constant only affects the loop itself. You would need to create a custom Theme which includes your app container.
Or you create a custom website that retrieves the data via the REST API.
See also: https://codex.wordpress.org/The_Loop#Using_The_Loop