WordPress.org

Ready to get started?Download WordPress

Forums

Latest Post on home page (8 posts)

  1. EricBays
    Member
    Posted 6 years ago #

    I have recently switched to excerpt displays and I love it. But I would like for it to only be in the category and archive list view. I would like for my index to be the full post of my latest post. Is there anyway to accomplish this?

    -Eric

  2. WPITn2shape
    Member
    Posted 6 years ago #

    This plugin's perfect:

    http://www.coffee2code.com/archives/2004/08/27/plugin-customizable-post-listings/

    I couldn't live with out it, although I use it for lists of links. Your way's a great idea for a site design, too, though.

  3. WPITn2shape
    Member
    Posted 6 years ago #

    Oh do you want #1 full post, and the rest, excerpts? That's a bit trickier...

    You'd use the plugin twice, with an offset for the rest, set it to the number you'd normally have then, minus one, like 9.

    That's the easiest way.

    Still you have to style it to look like regular post excerpts, but I think it CAN be done. Otherwise you have to get into more complicated Query Posts.

    http://codex.wordpress.org/User:JamesVL/query_posts

    Another feature I can't live without.

  4. EricBays
    Member
    Posted 6 years ago #

    This is not working out for what I need. And if it can then I have no idea how.

  5. moshu
    Member
    Posted 6 years ago #

    Make sure you have in your theme folder the following files:
    index.php
    archive.php
    single.php
    Have the_content in your index and single, and the_excerpt in your archive.php. This is the first step.
    Then use a plugin like CQS (custom query string) to set the number of posts displayed in different views: 1 post on home=index, XY on the rest.
    Done.

  6. WPITn2shape
    Member
    Posted 6 years ago #

    Oh the reason it doesn't work is compatibility with the new ver. THIS WORKS:

    For the first post...

    <?php
     global $post;
     $myposts = get_posts('numberposts=1&offset=0');
     foreach($myposts as $post) :
     setup_postdata($post);
     ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    	<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    	<?php if ( is_single() ) { ?><div class="meta"><?php the_author() ?> | <?php the_category(',') ?> | <?php the_time('l, d F Y') ?> <?php edit_post_link(__('Edit')); ?></div><? } ?>	
    
    	<div class="storycontent">
    		<?php the_content(); ?>
    	</div>
    </div>
     <?php endforeach; ?>

    For the 2nd post on...

    <?php
     global $post;
     $myposts = get_posts('numberposts=9&offset=1');
     foreach($myposts as $post) :
     setup_postdata($post);
     ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    	<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    	<?php if ( is_single() ) { ?><div class="meta"><?php the_author() ?> | <?php the_category(',') ?> | <?php the_time('l, d F Y') ?> <?php edit_post_link(__('Edit')); ?></div><? } ?>	
    
    	<div class="storycontent">
    		<?php the_excerpt(); ?>
    	</div>
    </div>
     <?php endforeach; ?>

    That plugin DOES work, but not always (anymore).

  7. WPITn2shape
    Member
    Posted 6 years ago #

    At least this works on pages. I keep forgetting what it is you want, with the excerpts, because your title is misleading. Hope this works.

  8. veevee
    Member
    Posted 6 years ago #

    This is great, adapting it to be just a link to the most recent post, does anyone know how to specify only one category?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.