• Hello everyone,

    I’m having some weird trouble with my excerpt in both posts and pages.
    I’ve installed a plugin which gives me excerpt in my pages, so I have it both in my posts and pages. I can display the excerpt for both pages and posts but it does not “cut” it off, in other words, it displays the entire excerpt. And in some places (for example my front page) it should only display like 100 or 150 characters and then give a “read more” link.

    I’ve tried some different approaches to get it to work, some tips and tricks I’ve found while searching for the problem my nothing works. Right now, I’ve gone back to basic and just use the the_excerpt() for my posts and $page->post_excerpt for my pages.

    If I make a var_dump of either my posts or pages I see the excerpt alright and it is also displayed, so I have a hard time figuring out what the problem is. When reading about it, it seems to be fairly easy to do a max-length for the excerpt but no matter what I’ve tried so far work.

    If you need any information, e.g. how I loop the pages / posts please let me know and I’ll provide it otherwise all comments or advices on this would be very much appreciated.

    Sincerely
    – Mestika

Viewing 9 replies - 1 through 9 (of 9 total)
  • hi Mestika,

    i am new to wordpress. i want to write my posts as pages and display those pages on my home page as summary . Is it possible to do this….

    Thanks in advance

    @crack3y
    your question is not really related;
    please start your own thread.

    @mestika

    handwritten/manual excerpts by default don’t get cut off.

    this might help, but could possibly be incompatible with your excerpt plugin for pages.

    Thread Starter Mestika

    (@mestika)

    Hi Alchymyth,

    thank you for your link. I’ve tried to follow it and inserted the function in my functions.php file but I get the same result, that is the whole excerpt is displayed.

    I do get a […] in the end but still in the end of the entire excerpt and with no link to it.

    It’s like my excerpt functionality get’s overwrite or just don’t apply to my theme.

    Do you have any other advices?

    Thread Starter Mestika

    (@mestika)

    Hey again Alchymyth,

    I got it to work now, but as you said, only on my posts excerpt and not on my pages. I probably have to dig into the code and try to make some sort of hack to get it to work on my pages excerpt as well.

    But nonetheless, thank you so much (again) for your answer and your link.

    not sure if it will work, but instead of:

    $page->post_excerpt

    you could try:

    apply_filters('the_excerpt', $page->post_excerpt)

    Thread Starter Mestika

    (@mestika)

    Well it works but unfortunately in the same way as before; everything in the excerpt area is getting displayed.

    i am at the end of my wisdom there – could be caused by the priorities of the filter functions, etc, of which i don’t have any great idea ??

    Thread Starter Mestika

    (@mestika)

    That totally fine, I’ll play a bit around with it but for now I’ve just used a simple php “hack” and use a substr function and append a [read more] tag at the end.

    It is not as elegant as the post excerpt function but it works better than just displaying everything and ruin the design.

    Thanks for your help

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘The excerpt tag display all the excerpt content and does not cut of?’ is closed to new replies.