Title: Using REST API in WP Theme?
Last modified: May 21, 2019

---

# Using REST API in WP Theme?

 *  [webgardengeek](https://wordpress.org/support/users/webgardengeek/)
 * (@webgardengeek)
 * [7 years ago](https://wordpress.org/support/topic/using-rest-api-in-wp-theme/)
 * I’m consulting on a project where the previous developer used the REST API (instead
   of WP Queries and WP functions) to retrieve posts and then display them with 
   Javascript loops. After a little troubleshooting, I have everything working functionally
   speaking, but the site seems to get pretty low page speed scores.
 * I have used the REST API many times for querying external sites, but never within
   a theme to retrieve posts from that same site’s db.
 * Is there any reason not to use the REST API from within a custom theme to query
   your own database or is it perfectly fine?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Kevin Vess](https://wordpress.org/support/users/kevinvess/)
 * (@kevinvess)
 * [7 years ago](https://wordpress.org/support/topic/using-rest-api-in-wp-theme/#post-11556874)
 * Hi– this doesn’t appear to be a question related to the Force Login plugin.
 * I suggest you try posting this question on the [Developing with WordPress Forum](https://wordpress.org/support/forum/wp-advanced/).
 * Thanks!

Viewing 1 replies (of 1 total)

The topic ‘Using REST API in WP Theme?’ is closed to new replies.

 * ![](https://ps.w.org/wp-force-login/assets/icon.svg?rev=1904031)
 * [Force Login](https://wordpress.org/plugins/wp-force-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-force-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-force-login/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-force-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-force-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-force-login/reviews/)

## Tags

 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kevin Vess](https://wordpress.org/support/users/kevinvess/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/using-rest-api-in-wp-theme/#post-11556874)
 * Status: not a support question