How to display the "recent posts" of WordPress on an external html page [closed]

0

I made a website using HTML & CSS and I created the blog in CMS Wordpress.

I have no experience with programming and now I need to search the database for the last 3 recent blog posts I created.

Does anyone have any suggestions on where to start?

    
asked by anonymous 20.01.2016 / 22:28

1 answer

1

Friend, I could not understand very well, in the next places more information like Theme used etc., good imagine that you need to add a new page to Wordpress it works with templates, within the folder of your theme usually stay in the root of these templates, get a copy and inside you can add the code of Wordpress that brings you the latest posts vide:

link

Inside the Wordpress codex is a lot of cool stuff.

In your case it would look something like:

first create a template: link

and inside the page the code that after the last posts:

<h2>Titulo Ultimo 3 posts</h2>
<ul>
<?php
    $args = array( 'numberposts' => '3' ); // aqui troca o numero pela quantidade de posts que queira trazer, e caso queira customizar mais o resultado vira aqui dentro do array () veja a pagina.
    $recent_posts = wp_get_recent_posts( $args );
    foreach( $recent_posts as $recent ){
        echo '<li><a href="' . get_permalink($recent["ID"]) . '">' .           $recent["post_title"].'</a> </li> ';
    }
 ?>
</ul>
    
21.01.2016 / 03:17