Viewing 3 replies - 1 through 3 (of 3 total)
  • Static Web page where? Inside WordPress – created by the page editor? Or just some regular HTML file?

    Here are the basics for PHP code that you can put in another PHP file (your static HTML page) – you’ll have to adjust this to fit into your own site (directory path, etc):

    <?php
    include('wp-config.php'); // include the basic WP startup stuff
    query_posts('showposts=10');  // get the last 10 posts
    while (have_posts()) { // got any posts?
    // start writing the HTML output for each post here....
        the_post(); // stuff the required parameters
        // write the title
        echo '<h3><a href="'.the_permalink().'">the_title().'</a></h3>';
        // write the content
        echo the_content();
    // etc etc etc
    }
    ?>
    Thread Starter orbitrod

    (@orbitrod)

    A regular HTML file, I will try your code and let you know how it goes.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Displaying posts on a static page’ is closed to new replies.