Forums

[resolved] Excerpts Don't Show up in home page (13 posts)

  1. tonycspc
    Member
    Posted 4 years ago #

    Hi - I entered in a post using the Advanced editing option and I put a summary in the exerpt field. When I publish and view the site, the entire article is posted. I did some searching in the forums and tried to play around with the php-exerpt bits that I saw, but it has become obvious I have no clue what I'm doing.

    All I want is for the excerpts to work as expected on the main page. Nothing fancy. Any ideas? (am I missing a checkbox somewhere?)

  2. moshu
    Member
    Posted 4 years ago #

    Two ways to do that - though they work in a different way.
    1. You can always add manually - while writing the post - the <more> tag from the quicktags menu wherever you want to be break the text
    2. You can replace the_content template tag with the_excerpt.
    The second solution would mean the whole content would never be displayed on the pages that use the index.php template.
    Be aware the_excerpt tag strips all the HTML markup. You should also know if you are not entering anything in the excerpt field when writing a post, WP will take automatically the first 120 words and displays them as "the excerpt".

  3. fcaoneyearbible
    Member
    Posted 3 years ago #

    moshu - when I look at the Theme editor in my admin pages, I don't see an "index.php" ... I have:
    post.php
    author.php
    profiles.php (something I've created that doesn't work)

    I also have a Main Index Template, which when I select it, it says I'm editing the Index.php ... however ...

    I don't see the_content in that code ... here is the main part of that code (I think) ..

    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <div class="post">
    <?php require('post.php'); ?>
    <?php comments_template(); // Get wp-comments.php template ?>
    </div>

    Any ideas? What I'm hoping to do is have the full post show up on the main page (I only display 1 day at a time) and then when sorted by category, show the_exerpt.

    I also would like the_exerpt to show on my author.php, and then have all the posts for that author, but currently only the most recent post shows up (though it is the_exertp)

    Sorry ... that may be many questions under this one topic!

  4. skulled
    Member
    Posted 3 years ago #

    Check your post.php file, you should find the reference to the_content() in there ..

  5. fcaoneyearbible
    Member
    Posted 3 years ago #

    Yes ... I do see the_content in post.php. Here is the code I have now:

    <?php if(is_category() || is_archive()) { the_excerpt(); } else { the_content(); } ?>
    <div class="post-info">
    <?php wp_link_pages(); ?>
    </div>
    <!--
    <?php trackback_rdf(); ?>
    -->
    <div class="post-footer"> </div>
    </div>

    This works correctly, EXCEPT would love to display every post (that fits the category) on this page, rather than the link to pages. I've taken out <?php wp_link_pages():?> but I still see "Next page" and only one post on each page (except author.php, where I only see one post with no "Next page" option)

  6. skulled
    Member
    Posted 3 years ago #

    To display the post itself and not the excerpt and link to the pages:

    Change this:


    <?php if(is_category() || is_archive()) { the_excerpt(); } else { the_content(); } ?>

    to:


    <?php the_content(); ?>

  7. moshu
    Member
    Posted 3 years ago #

    <?php wp_link_pages(); ?>
    has nothing to do with seeing the "Next Page".
    This template tag serves to "paginate" very long posts by inserting the <!--nextpage--> quicktag.

    The "next.." "previous..." appear in any view if you have more posts than the number of posts set in Options > Reading.

  8. fcaoneyearbible
    Member
    Posted 3 years ago #

    Ok ... I'm just sort of confused on this. Maybe if I tell you what I'd like, and you see my site, you might be able to tell me what needs adjusting:

    I would like on the Home Page to see all the posts for that day. (this works correctly right now)

    When searching by a category, I'd like to see excerpts of every post. (right now, it only works if the posts that share a category happened to be created on the same day)

    When looking at the author.php, I'd like to see excerpts of every post. (right now, I have to click "Next Page" to see the next post).

    I do have my Options >Reading set to Show at most 1 days ... is this the culprit, and if so, how do I prevent all the posts from showing up on the home page?

  9. fcaoneyearbible
    Member
    Posted 3 years ago #

    I'm slowly figuring this out. I have adjusted Options>Reading to be Show 500 posts. Now everything works correctly except my Home Page (I see all the post).

    I'm thinking somehow I need to use the Single-post.php for that page, by adjusting the templatae heirarchy or something like that.

    Am I on the right track? I'm about 4 clicks away from getting my blog to looking exactly like I want it, so thanks for the help!

  10. moshu
    Member
    Posted 3 years ago #

    No, I am afraid you are not.
    (Good to know though that 500 number to make sure I'll avoid your site:)
    Showing posts per day seems to have a bug.
    For having different category views I always go by using Category_Templates.

    You cannot use the single.php for home page. WP won't let you do that.
    If you want different number of posts on different views - you'll have to use a plugin:
    http://mattread.com/archives/2005/03/custom-query-string-plugin/
    http://rephrase.net/miscellany/05/perpage.phps

  11. fcaoneyearbible
    Member
    Posted 3 years ago #

    Thanks ... I just stumbled on those two plug ins in another thread, but I wasn't sure if I can use them with WP2.0? Let me know if those plugins are safe to use, and I'll be set!

    As for showing at most 500, I get it now ... reading options doesn't limit the filter of the posts, it just shows x number of posts on that page, and then if there are more than that, gives you the "next page" link. (I adjusted to 5 posts, so you can visit my site! :))

  12. moshu
    Member
    Posted 3 years ago #

    I have installed the first plugin on a 2.0 and it works perfectly. Didn't check to other one - yet.

    Without the plugin (or specific query_posts use) the number of posts set in the Options applies to all views in WP.

  13. fcaoneyearbible
    Member
    Posted 3 years ago #

    Great ... I went to Matt's site for the plug in (CQS) and he has a version 2.6 which I installed ... works PERFECTLY!

    I've got it all doing just what I want ... thanks for ALL your help!

    Well, with the exception of what may be a farfetched dream ... I would like to have a specific page (dynamic if possible) that lists all the authors and a link to the dynamic author.php. I'm looking for the exact same thing as I have in my sidebar (listing all the authors) but a dedicated page and I'd like it to link to an author even if they haven't posted yet. You might see on my site a link at the top "Author" ... that's what I would link from

Topic Closed

This topic has been closed to new replies.

About this Topic