• I’m trying to show just the title of the latest post on the home-page of a WP site I’m building.

    I’ve found this code that works:

    <?php query_posts(‘showposts=1’); ?>

    <?php while (have_posts()) : the_post(); ?>
    “><?php the_title(); ?>

    <?php endwhile;?>

    but as a result it removes the content I have entered in the page in the WP control panel and inserts the content of the post instead.
    I have read that adding the query_posts affects the loop.

    The code I’m using to draw in the contents of the page is :

    <?php the_post(); ?>

    <?php get_template_part( ‘content’, ‘page’ ); ?>

    <?php comments_template( ”, true ); ?>

    Any ideas on how

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show title of latest post on home-page’ is closed to new replies.