[resolved] Displaying my latest post on a seperate website (5 posts)

  1. tktest
    Posted 4 years ago #

    Hi All,

    Im pretty new to wordpress and have come across something that i just cant find the answer to...

    I have integrated a blog/news sections into a site i am building and it took a while to get it on the website but it's on now and working pretty well.

    The thing is i simply installed the wordpress blog into a sub directory called news but i really want to display my latest post on the actual homepage of the website.

    Does anyone know how to do this?



  2. sales@4bco.com
    Posted 4 years ago #

    My advise would be to run the whole site from WordPress & set the home page to display latest posts in the admin section.

  3. I agree with sales@4bo.com

    If you set your home page as a WordPress page, then you can modify the front-page.php template to display your home page content and the latest post.

  4. tktest
    Posted 4 years ago #

    Thanks guys your tips helped alot, i have managed to sort this now.
    I added this above everything in the homepage…

    <?php /* Short and sweet */ define(‘WP_USE_THEMES’, false); require(‘news/wp-blog-header.php’); ?>

    and then this where i wanted the post to display…

    <?php query_posts(‘showposts=1’); ?> <?php while (have_posts()) : the_post(); ?> <?php getImage(‘1’); ?>
    <?PHP THE_TITLE(); ?>
    <?php the_excerpt(); ?>
    read more <?php endwhile;?>

    this works great.

  5. sales@4bco.com
    Posted 4 years ago #

    Glad you got it to working!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.