you finally can 2. Your content needs to update or change dynamically 3. You want to separate your business logic from your views 4. You don’t like PHP 5. You just spent the past 2 years of your life working on the WP REST API project
the header and footer logic in our single template file (index.php) 3. Enqueued our JavaScript and CSS files (functions.php) 4. Defined our routes and initialized our client-side router (main.js) 5. Added an event handler to route visitors that click on our logo image in the header to our homepage (main.js)
of #posts-tmpl to handle the display of our Posts list (index.php) 2. Filled-in the logic in our listPostswithPagination callback to send a GET request to the WP REST API Posts endpoint and pass the response data to our Underscore template (main.js) 3. Added the presentation logic to our Underscore JS template that loops through the data passed, displaying the title and excerpt for each Post (index.php)
pagination values are relevant and, if so, include them in the data passed to the #posts-tmpl Underscore template (main.js) 2. Added the presentation logic to the #posts-tmpl Underscore JS template that displays the pagination links at the bottom of the Posts list (index.php)
of #post-tmpl to handle the display of a single Post (index.php) 2. Filled-in the logic in our viewPost callback to send a GET request to the WP REST API Posts endpoint with query params for the Post slug and embedding related data. We pass the response data to our #post-tmpl Underscore template (main.js) 3. Added the presentation logic to our #post-tmpl Underscore JS template that displays the featured image, title, author avatar, author name, and content for the Post (index.php)