views:

40

answers:

2

I have a static website, and i like to take some (+ or - 15) post from my 200 post wordpress and get it in a static website with design and thing really different from the blog

i have get that code :

<?php
$my_id = 1828;
$post_id = get_post($my_id); 
echo $post_id;
?>  

but how to tell the address of the blog, and how to get the database texte from post 1828

A: 

Here is the final wordking code for me

<?php require('../mywebsite.com/wp-load.php'); 

function getmypost($number)
    {
        query_posts('p='.$number);
        while (have_posts()) : the_post();
        echo '<div class="post">';
        the_title('<h1>', '</h1>');
        the_content();
        echo '</div>';
        endwhile;
    }
marc-andre menard
A: 

Your working code is great if you only use it on your own site. If you do it often and on other sites or in plugins, this is worth a read: http://ottodestruct.com/blog/2010/dont-include-wp-load-please/

Greenie