• Resolved hummerton

    (@hummerton)


    Hello all ??

    I am new to wordpress and keep reading about widgets and such. I have a wp blog on my website and I would like to have the last 10 blog posts show on my homepage (html page).

    How do I do this?

    Thanks,

    Rob

Viewing 5 replies - 1 through 5 (of 5 total)
  • Have you considered using the static front feature of WordPress for that?

    If that’s not your cup of tea, then look at Integrating_WordPress_with_Your_Website or using a feed.

    Thread Starter hummerton

    (@hummerton)

    I have a PHP website and a blog directory. If I want to show the last 10 posts, then this is the code I understand.

    // Get the last 10 posts.
    <?php
    require('/blog/wp-blog-header.php');
    ?>
    
    <?php query_posts('showposts=10'); ?>
    <?php while (have_posts()) : the_post(); ?>
    " rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?>
    <?php endwhile;?>

    Is the path correct? Just the path to your blog?

    Thanks,

    rob

    Thread Starter hummerton

    (@hummerton)

    Guess not, I get this error…

    Warning: require(/blog/wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/shopit1/public_html/index.php on line 415

    Fatal error: require() [function.require]: Failed opening required ‘/blog/wp-blog-header.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/shopit1/public_html/index.php on line 415

    It’s probably

    require('/home/shopit1/public_html/blog/wp-blog-header.php');

    Related:
    https://www.ads-software.com/support/topic/342479

    Thread Starter hummerton

    (@hummerton)

    Yep, that was it ??

    Thank you very much.. I do appreciate it. I will continue to look around to see what else I can learn with this.

    Thanks,

    Rob

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show last 10 posts on homepage (not blog page)’ is closed to new replies.