WordPress.org

Ready to get started?Download WordPress

Forums

how do i change Excerpt Length for posts (10 posts)

  1. oberheimer
    Member
    Posted 2 years ago #

    I have to change in the code and i have no idea. I tried to change the value 50 to more but does'nt seem to change anything. Here is the code

    [Code moderated as per the Forum Rules. Please use the pastebin]

  2. Luca Hammer
    Member
    Posted 2 years ago #

    As it seems that you aren't that used to code, I would suggest you use a plugin which does most of the work for you: http://wordpress.org/extend/plugins/advanced-excerpt/

  3. oberheimer
    Member
    Posted 2 years ago #

    I have tried that but nothing happens i even changed to full post but i only see the 50 excerpt

  4. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    You need to edit the All Posts template to call for the content not the excerpts. The default excerpt length is 55 words I believe.

  5. oberheimer
    Member
    Posted 2 years ago #

    But how do i change the all posts template i'm not good at coding :p
    Lets say i want full posts or 200 words...

  6. timDesain
    Member
    Posted 2 years ago #

    try:
    add this code to theme's function.php

    add_filter( 'excerpt_length', 'td_excerptLength' );
    function td_excerptLength( $length ) { return 100; }

    change your excerpt code

    <div class="excerpt"><?php the_excerpt(); ?></div>
  7. oberheimer
    Member
    Posted 2 years ago #

    I have tried that but did'nt work. I use a templatemonster so...
    I wont do that again... too complicated and they try to define everything so even when you try and change a simple thing it makes it difficult

  8. oberheimer
    Member
    Posted 2 years ago #

    No flexibility at all imo

  9. esmi
    Forum Moderator
    Posted 2 years ago #

    I've used the code described by timDesain many times and it has always worked for me. I can only assume you did not add it correctly, you added it to the wrong file or your theme has its own custom excerpt function.

  10. oberheimer
    Member
    Posted 2 years ago #

    esmi thanks, i guess i did'nt add it correctly then i will try again :D

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.