EvanAgee / vuejs-wordpress-theme-starter

A WordPress theme with the guts ripped out and replaced with Vue.
https://vuewp.com/
1.6k stars 282 forks source link

Visitor comments? #58

Closed giekaton closed 5 years ago

giekaton commented 5 years ago

Can't find a way how to show visitor comments for a page/post. Any ideas?

In wp Settings->Discussion comments are allowed, and also in page/post settings.

giekaton commented 5 years ago

Theme code doesn't have comments code. Can be included in index.php like this:

<div id="app"></div>
<?php comments_template(); ?>
<?php wp_footer(); ?>

The problem then is that router client side links don't load comments for different pages, when navigating. Only the initial page comments are loaded.

Probably need to fetch comments with REST API...

EvanAgee commented 5 years ago

@giekaton you're correct, you would need to implement comments via the REST API. Remember, we're COMPLETELY outside of the normal WordPress theming environment so the typical PHP solutions won't apply. This should, however, be relatively simple and I'll consider adding some documentation to demonstrate how you could do this.