title: I need to show recent two wordpress posts in my codeigniter site at home page
body: <p>Please provide the code for how to integrate. I kept blog inside at public_html folder and blog has one database and site has other database I have created.</p>
  
  <p>I have tried these code at my site <code>index.php</code></p>
  
  <pre><code>&lt;?php require('blog/wp-blog-header.php');?&gt;
  
  &lt;?php
      $args = array( 'numberposts' =&gt; 2, 'post_status'=&gt;"publish",'post_type'=&gt;"post",'orderby'=&gt;"post_date");
      $postslist = get_posts( $args );
  
      foreach ($postslist as $post) : setup_postdata($post); ?&gt;
         &lt;div class="events"&gt;
               &lt;p&gt;&lt;strong&gt;&lt;?php the_date(); ?&gt;&lt;/strong&gt;&lt;/p&gt;
             &lt;p&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/p&gt;
        &lt;/div&gt;
  &lt;?php endforeach; ?&gt; 
  </code></pre>
  
  <p>but shows an error like </p>
  
  <pre><code>Fatal error: Call to undefined function wp_get_recent_posts() in 
  /home/sharelok/public_html/application/views/index.php on line 124
  </code></pre>