Grow your CSS skills. Land your dream job.

WordPress Read Article / Comment »

  • # March 6, 2009 at 12:41 am

    I notice on the css-tricks front page on a post it says ‘Read Article / Comment »’ and it goes to a div of more but it only shows when there is more content. how do you do that?

    # March 6, 2009 at 3:28 am

    the front page is stealing an excerpt from the loop, so basically, there is a page made for the full post, but on the home page he is stealing the excerpt.

    on a page you want the excerpt it needds to be a php page and have this at the top:

    Code:
    < ?php
    // Include WordPress
    define('WP_USE_THEMES', false);
    require('/path to your header/wp-blog-header.php');
    query_posts('showposts=1');// 1 or more
    ?>

    then somewhere on that page you want to show the excerpt, then place this in your page:

    Code:

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

    < ?php the_title(); ?>

    < ?php the_excerpt(); ?>

    “>Read more…

    < ?php endwhile; ?>

    # March 7, 2009 at 1:40 pm

    Thanks :D :D

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".