SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    After 1st post - I want excerpts.

    I want to modify my blog. I want to show full read for ONLY 1st post. After 1st post, I want to show excerpts of the post with read more link.

    I'm PHP noob. I have no idea how to do this. Even though, I read wordpress documentation 10 times. I can't get this to work.

    Any help will be appreciated.
    Design to WordPress
    Free powerful and user-friendly control panel included.
    PM me for 10% refund discount on your first order.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,440
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    excerpts

    The codex can be a bit hard to digest at times. You may have better luck with Lorelle's explantions and examples
    http://lorelle.wordpress.com/2006/07...-in-wordpress/

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    The codex can be a bit hard to digest at times. You may have better luck with Lorelle's explantions and examples
    http://lorelle.wordpress.com/2006/07...-in-wordpress/
    Thanks,

    I'm going to trial and error, soon.

    Design to WordPress
    Free powerful and user-friendly control panel included.
    PM me for 10% refund discount on your first order.

  4. #4
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    How about something like:
    PHP Code:
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); $postcount++; ?>

    <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <p class="date"><?php the_time('F jS, Y'?> <!-- by <?php the_author() ?> --></p>

    <?php if ($postcount == 1) { ?>
    <?php the_content
    ("Continue reading: " the_title(''' &raquo;'false)); ?>
    <?php 
    } else { ?>
    <?php the_excerpt
    () ?>
    <p><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read more of <?php the_title(); ?></a></p>
    <? ?>

    <p class="postmetadata">Posted in: <?php the_category(', '?> | <?php comments_popup_link('No Comments ''1 Comment ''% Comments '); ?> <?php edit_post_link('Edit',' | ',' '); ?></p>

    <!--
    <?php trackback_rdf(); ?>
    -->

    <?php endwhile; ?>
    This replaces the loop in index.php. Seems to work, if I understood what you wanted.

  5. #5
    SitePoint Enthusiast michaelper22's Avatar
    Join Date
    Apr 2007
    Location
    New York City
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Johnny Gulag View Post
    This replaces the loop in index.php. Seems to work, if I understood what you wanted.
    Remember to set the variable before entering the loop, and change it somewhere within the first run of the loop so that you get the desired effect.

  6. #6
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Johnny Gulag View Post
    How about something like:
    PHP Code:
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); $postcount++; ?>

    <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <p class="date"><?php the_time('F jS, Y'?> <!-- by <?php the_author() ?> --></p>

    <?php if ($postcount == 1) { ?>
    <?php the_content
    ("Continue reading: " the_title(''' &raquo;'false)); ?>
    <?php 
    } else { ?>
    <?php the_excerpt
    () ?>
    <p><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read more of <?php the_title(); ?></a></p>
    <? ?>

    <p class="postmetadata">Posted in: <?php the_category(', '?> | <?php comments_popup_link('No Comments ''1 Comment ''% Comments '); ?> <?php edit_post_link('Edit',' | ',' '); ?></p>

    <!--
    <?php trackback_rdf(); ?>
    -->

    <?php endwhile; ?>
    This replaces the loop in index.php. Seems to work, if I understood what you wanted.
    Thanks,

    It worked.

    http://www.proxybucket.com/blog/
    Design to WordPress
    Free powerful and user-friendly control panel included.
    PM me for 10% refund discount on your first order.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •