WordPress.org

Ready to get started?Download WordPress

Forums

Mix of excerpts and full entries on front page? (10 posts)

  1. jzahlaway
    Member
    Posted 9 years ago #

    (Cross-post; originally posted here before I realized which forum I was actually in. This one seems like a better choice.)

    I followed the suggestion here to successfully end up with a front page that publishes excerpts ... but not the way I was hoping it would.

    I would like full entries to appear on the homepage for all entries for which the excerpt block was left blank, and for excerpts to appear only for entries for which an excerpt was entered during post creation. Seems like this should be the default function ... but, instead, I now have excerpts only for ALL entries.

    Help?

  2. Nick Momrik
    Member
    Posted 9 years ago #

    Using the_excerpt you always get an excerpt. If you haven't entered one, WP creates one by pulling the first part of your post content. This makes sense to me....if you ask for an excerpt, you get one.

  3. jzahlaway
    Member
    Posted 9 years ago #

    That doesn't answer my question.

  4. Nick Momrik
    Member
    Posted 9 years ago #

    You are going to have to do a test on the DB.

    Run a query to check if the excerpt field is empty in the DB for the post you are processing. If it's empty, call the_content. If not, call the_excerpt.

    It's going to require a little hacking.

  5. jzahlaway
    Member
    Posted 9 years ago #

    Serious question (really not trying to sound like a smartass; this is my first day on this board, so I'm not yet clear about what the average level of skill is assumed to be.):

    Is it assumed that the skill level of the average user posting on this board is such that the response above--concluding with "It's going to require a little hacking"--sufficiently answers the question "How do I get full entries to appear on the homepage for all entries for which the excerpt block was left blank, and for excerpts to appear only for entries for which an excerpt was entered during post creation?"? If so, does anyone know of a board where the learning curve starts a little lower?

  6. Nick Momrik
    Member
    Posted 9 years ago #

    No, the average skill level isn't a assumed to be that of a hacker.

    But that is in essence what you're asking for and I was just letting you know that. It's going to require some custom code to do what you want.

    Sorry if I sounded out of line. I was just trying to answer your question as quickly as possible.

  7. moshu
    Member
    Posted 9 years ago #

    Serious answer :)
    The answer you've got to your question tells that to achieve what you wish requires coding knowledge (a.k.a. "hacking") otherwise it is not possible. It also says there is no such hack (yet). If it was, they would have linked to it.

    As it is for the moment you can either call for the whole post or for excerpt for ALL the entries. Actually a kind of workaround would be to use the <more> tag for certain posts and not to use it for others.
    Hope this helps.

  8. Nick Momrik
    Member
    Posted 9 years ago #

    Well said moshu. Thanks for clearning that up. :-)

  9. jzahlaway
    Member
    Posted 9 years ago #

    Thanks, guys.
    I know how to write PHP, but it seems navigating through the various includes/etc. to find what I need is going to be tricky.

    I'm surprised that the result I wish to achieve is such an anomaly; seems like a no-brainer setting that would/should be built in.

    Edit: The <!--more--> tag is a pretty good workaround. I wasn't aware of its existence before. Thanks for the tip!

  10. tdw
    Member
    Posted 9 years ago #

    I posted a reply here

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.