title: Difference between get_pages() and get_posts() functions in WordPress
body: <p>I am bit confused about above two. However, I am aware about the nature of both the functions.</p>
  
  <pre><code>1. get_pages() - fetches all pages from db.
  2. get_posts() - fetches all posts from db.
  </code></pre>
  
  <p>But, my question is, when to use these functions? Do both of them return all the pages/posts which we can get through <code>WP_Query()</code> or do they both work in different ways?</p>