• ke vinritt

    (@ke-vinritt)


    Hi,
    I have a home page that I just want to display a sentence or two of the last three blog entries. When someone clicks on each link it takes them to our blog page. Is that doable? I searched the Codex but nothing turned up as specific as what I am looking for.

Viewing 2 replies - 1 through 2 (of 2 total)
  • offspring

    (@offspring)

    I used this code on my site (ilia.org.il) to show last 5 posts. Place it in page.php theme file:

    <?php
    	if (is_front_page()) {
    ?>
    	<h1 class="entry-title">Recent posts</h1>
    	<div class="entry-content">
    		<ul style="list-style-type:none">
    <?php
    	global $post;
    	$myposts = get_posts('numberposts=5');
    	foreach($myposts as $post) :
    		setup_postdata($post);
    ?>
    	<li style="font-size:110%">&raquo;&nbsp;<?php the_time('d/m/Y'); ?>&nbsp;&mdash;&nbsp;<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach;
    }
    ?>
    </ul></div>

    Thread Starter ke vinritt

    (@ke-vinritt)

    That works – thanks offspring

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