• I have a static html page that I want to have my recent blog posts titles display in. I’ve gotten something like this to work before, but the tricky thing about this one is that the static html page is in a different directory than the wordpress installation.

    This is the code I’m trying to use:

    <ul>
    <?php
    global $post;
    $myposts = get_posts('numberposts=5&offset=0');
    foreach($myposts as $post) :
    setup_postdata($post); ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>

    So is there a way to make this these php snippets somehow link to the wp installation from the static html page?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get_posts from /blog to show on static html page’ is closed to new replies.