Forum Replies Created

Viewing 1 replies (of 1 total)
  • I wanted to do the same thing so I created an iframe in my html file –

    <iframe src="headlines.php" name="blog" width="170" scrolling="no" frameborder="0" ><a href="http://www.yourdomain.com/headlines.php" title="whatever u want"></a></iframe>

    Then created a php page, added the following code and titled it ‘headlines.php’

    <?php
    $how_many=4; //How many posts do you want to show
    require_once("wordpress/wp-config.php"); // Change this for your path to wp-config.php file ?>
    <?
    $news=$wpdb->get_results("SELECT
    ID,post_title FROM $wpdb->posts
    WHERE
    post_status= \"publish\" ORDER BY 'ID' DESC LIMIT ".$how_many);
    foreach($news as $np){
    printf ("
    <li><a>%s</a></li>
    ", $np->ID,$np->post_title);
    }?>

Viewing 1 replies (of 1 total)