WordPress.org

Ready to get started?Download WordPress

Forums

the_content () - Working on single posts? (5 posts)

  1. fgluck
    Member
    Posted 7 years ago #

    I have a home page with the following code:

    <code>

    <div id="hp_story_1">
    <?php get_a_post(38); ?>
    <!-- Get post #38 (home_page_1 story -->
    <?php the_content('more... »',FALSE); ?>
    </div>
    <!-- End of hp_story_1 -->

    <div id="hp_story_3">
    <?php get_a_post(40); ?>
    <!-- Get post #40 (home_page_3 story -->
    <?php the_content('more... »',FALSE); ?>
    </div>

    <div id="hp_story_2">
    <?php get_a_post(39); ?>
    <!-- Get post #39 (home_page_2 story -->
    <?php the_content('more... »',FALSE); ?>
    </div>

    </code>

    The intention is to show an excerpt of a PAGE (not a post) on three seperate blocks on the home page.

    I have put the <!--more--> tag in the hp_story_2 page and the entire post is being shown.

    Am I using this tag correctly? I am unclear from the codex documentation what exactly...

    <blockquote>
    The <!--more--> quicktag will not operate and is ignored if there is only one post being displayed."
    </blockquote>

    means. I also read that permalinks have something to do with this tag working.

    Any suggestions about how to get this working?

  2. moshu
    Member
    Posted 7 years ago #

    It might be related to the fact that the "more" tag on Pages doesn't work.

  3. fgluck
    Member
    Posted 7 years ago #

    Then any suggestions for a method of showing excerpts of a page similar to the way you can do it with a post?

  4. moshu
    Member
    Posted 7 years ago #

    I have never tried... but what if you put the_excerpt tag in the plugin call (instead of the_content)?
    It's worth a try :)

  5. fgluck
    Member
    Posted 7 years ago #

    I settled on a combination of the "Get A Post" plugin
    here at:

    http://guff.szub.net/2005/01/27/get-a-post/

    and the following code...

    <div id="hp_story_2">
    <?php get_a_post(39); ?> <!-- Get page ID #39 -->
    <?php the_content_rss('',0, '',30); ?>
    ">» » »...
    </div>

    Guess you can do anything in WordPress!!

Topic Closed

This topic has been closed to new replies.

About this Topic