Support » Fixing WordPress » Optional Excerpt Not Working

  • Resolved zensurfer


    Hi All

    I’m trying to use “Optional Excerpt” when I write a post because my posts are pretty long, but nothing seems to happen.

    No snippet appears with “Read More” or something like that only the full post shows.

    Any ideas people?



Viewing 11 replies - 1 through 11 (of 11 total)
  • Optional excerpt won’t be used if your Theme is using the_content() to display posts as opposed to the_excerpt().

    If editing your theme is viable, I’d make that change in index.php.

    If not, consider using the <!--more--> feature instead.

    <!–more–> and the_excerpt are redundant. use the first — of the two, it makes the most sense.

    What do you mean by “use the first — of the two” I don’t understand what you mean can you please explain a little more?

    What are steps I need to do?



    use the <!–more–> tag.

    Thanks Denis

    Related question: My optional excerpts show in the categories and archives. If i have set no optional excerpt, the text is simply chopped off automaticly and that’s all right with me. But because my articles are usually very long, i want to give an excerpt at the front page, too.
    Do i just have to change the function the_content() to the_excerpt() in the index.php or do i have to set rules for articles without optional excerpt, too? And how can i involve some button or link like “read more”, instead of […] at the end of each excerpt?
    I don’t want to use the <!–more–> tag, because that’s chopping off articles in feeds, too and at least i don’t want my theoretical essays simply being chopped off. 😉

    Do i just have to change the function the_content() to the_excerpt() in the index.php

    And how can i involve some button or link like “read more”, instead of […]
    If you search you may find some code that you would have to insert manually in the template file.
    Another option is to use a plugin:

    Okay, excerpts are now working for front-page, too, but there’s still my “read on” problem. If i have no optional excerpt, my theme shows […]. If i have an optional excerpt it shows nothing. So let’s assume, i know which code to enter or at least have an idea, where is the function the_excerpt() generated/defined? Means, where do i have to change code for getting a “read on” or in case of an excerpt a “read full entry”. It seems not to be the index.php of my theme, because that’s just where the function is called.

    (ps.: I don’t want to use the plug-in for two reasons. It’s talking about the loop to which i have no clue at all and second i want to learn about my php code to improve my hacking abilities.)

    If you replaced the_content with the_excerpt… you were just editing in the middle of the Loop.

    And learning what The_Loop is could be a good start to “improve your abilities” 🙂

    I don’t provide support for hacking core files because
    a) I don’t know how to do it
    b) it’s a bad practice for those that don’t have the ability to do it on their own
    c) I don’t want to increase a noise in the forum (i.e. when you come back crying about your screwed up blog)

    😉 Okay, can understand that. So i’m learning about the loop. If the plugin can create a “read on” link there, so maybe can i.

    Me again. I tried the plugin and it didn’t fit my wishes, so i decided to “mess up the core files” and succeeded. I found the function wp_trim_excerpt in wp-includes/formatting.php and changed the line array_push($words, '[...]'); to array_push($words, '<a href="' . apply_filters('the_permalink', get_permalink()) . '" rel="bookmark" title="more-link">read on �</a>');
    Now it looks just like what i wanted. I’ll see if it’s stable. Thanks to forum-members and Jowra

    Another helpful site was: Customizing the Read More

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Optional Excerpt Not Working’ is closed to new replies.