I'm building a WordPress headless theme that is using vue 3 under the hood.
I'm able to load vue inside a page template, and I've fixed a problem I had with routing when a page were refreshed.
Now I'm facing the i18n internalization problem, I need to have the site translated into different languages, is there a way to do this in an headless theme?
If it was a traditional WP theme there are a lot of plugin that are doing this, but how I can manage this aspect in my vue app by using wp as backend?
Related
I have been developed a wordpress plugin along with vue js. Right now i want make this plugin multi lingual.
Can you guys please helps me out to how i can use vue i18n in wordpress plugin.
I tried to use wp-vue-i18n. But still failed because of proper documentation.
I am trying to implement a theme on my website. I went to Appearance implement the owner theme composer and after I implemented all the pages of the template. When the sites open up I just see the coding and less images.
I have an existing website where I am gradually replacing the html/css interfaces with Vue technology. So now I have pages with two logics
Pages completely in vue
Pages with html/css parts and vue parts.
Currently I am using Vue (without Nuxt) with success to do this migration. In my wordpress theme I load vue scripts as follows
wp_register_script('vue-app', $directory_uri . '/js/app.js', array(), $version, true);
wp_enqueue_script('vue-app');
In order to improve my project I am switching to Nuxt. But I can't keep the same logic of integration. Nuxt does not create a unique app.js. Nuxt is generating a whole bunch of files and I cannot load them synchronously. Neither in build nor in dev (hot-module-replacement).
I don't know how to keep my logic 1 and 2 with Nuxt. Do you have any solutions ?
If you want to use Nuxt to it's full potential and keep Wordpress, you need to use Wordpress as a headless CMS. Meaning that you may use Full static and generate all of your pages during build time by reaching to your Wordpress app.
I guess that your current Wordpress + Vue flow is lacking SEO hence why you're trying to reach upon Nuxt. But to my knowledge, you will not be able to just plug it like that with your wp_register_script.
Or maybe try to mount it for every one of your routes .../about, .../our-team etc... Not a wordpress expert tho.
I have a Wordpress site using a generic theme. I made React app I would like to use as a frontpage of my site. Already collected data using REST API. How can I integrate my bundle.js into existing Wordpress page?
I think you can use shortcode like this [my_shortcode] in some wordpress page.
Then you need to implement it in your plugin (or new plugin if you have no plugins).
just add the following
add_shortcode( 'my_shortcode', 'my_shortcode_handler' );
In your my_shortcode_handler you can serve the html,js,css of your React App
By using some WP functions like:
wp_enqueue_style
wp_enqueue_script
I am using Wordpress to build a facebook application. The application uses a plugin for hosting a small quiz, and I used a wordpress plugin for the quiz.
However, after this I had to include a like gate for the application page, so I included facebook.php in the index page. Now the quiz plugin is no longer working.
Can anybody let me know if the facebook.php can cause conflicts with the Wordpress plugins and if yes, how can it be circumvented?
It shouldn't conflict because the Facebook PHP isn't Wordpress specific and is a self contained class, so there's unlikely to be any function naming issues etc, unless you are using a plugin to load the Facebook API? Have a look at your error logs in the site route and plugin folders.