WordPress.org

Support

Support » Plugins and Hacks » [Plugin] One post some titles on homepage

[Plugin] One post some titles on homepage

  • I’m looking for a plugin that will help me getting the follow result:

    – Show 1 complete post on the homepage
    – Show the titles of last 10 posts, linking to the complete post page.

    Do you know a plugin like this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You don’t need any plugin for that. That is a theme design/coding issue.
    And there have been posts in the forum describing how to do that.

    you might get lucky by searching for “featured post” too.

    Basically, you edit your index.php. the simplest would be to add a counter and display the first post differently.

    Basically your loop goes like this:

    <?php
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<h1><?php the_title(); ?></h1>
    	<p><?php the_content(); ?></p>
    <?php endwhile; ?><?php endif; ?>

    Change it to

    <?php
    $postnum = 1;
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    	if ($postnum==1) { ?>
    		<h1><?php the_title(); ?></h1>
    		<p><?php the_content(); ?></p>
    	<?php } else { ?>
    		<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    	<?php } ?>
    	<?php $postnum++; ?>
    <?php endwhile; ?><?php endif; ?>

    Display content only on first post, show the rest of the posts only in headline 2 with link.

    Digitalminds

    @digitalminds

    It seems not to work. When I place the code above in the index.php file nothing is changed at my homepage but my full-post page doesn’t work anymore. So I thought it was code to place the code in the home.php file, but then my homepage doesn’t work anymore. Can someone help me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin] One post some titles on homepage’ is closed to new replies.
Skip to toolbar