WordPress.org

Ready to get started?Download WordPress

Forums

Pinboard
[resolved] Changing Excerpt Length (8 posts)

  1. bgiannak
    Member
    Posted 1 year ago #

    Hi!
    Im trying to change the excerpt length shown in the post previews on the homepage.I have change the length to 20 in all in the footer.php in this sector but nothing happened .

    function pinboard_excerpt_length( $length ) {
    if( pinboard_is_teaser() ) {
    if( has_post_format( 'aside' ) )
    return 32;
    else
    return 20;
    } else
    return 50;

    is there anything else i could try ?
    thank u !!!

  2. omggimme
    Member
    Posted 1 year ago #

    Hi there.

    I just edited the /wp-content/themes/pinboard/functions.php page, inside that file, I all I did was change the 20 to 100, save and refresh. Your front page should display 100 instead of 20, unless the post is classified as ASIDE.

  3. omggimme
    Member
    Posted 1 year ago #

    oh ignore my last comment, you should really create a CHILD theme first and then edit the functions.php in that theme. The reason for this is if you update your original theme (Pinboard for this exmaple), you will not lose your work.

    It's actually really easy to make a child theme, you can read up on it here: http://codex.wordpress.org/Child_Themes

  4. bgiannak
    Member
    Posted 1 year ago #

    Thank you very much!i will try it as soon as possible.I did not mention it well although...I want to reduse the length of the excerpt because now is about 100+ and i want it to be around 15-20. I guess that i could make it with a Child theme as you mention it before ????

  5. omggimme
    Member
    Posted 1 year ago #

    Well since you already modified the original, I would recommend you reinstall the theme and get the original files back into the /pinboard directory. And then create a new child theme /pinboard-child and modify the functions.php in the child going forward.

    Hopefully you havent made many mods to any of the original files.

  6. bgiannak
    Member
    Posted 1 year ago #

    omggime i have created a child theme. In the editor i see only .css and .rtl. I have created a file into the child theme, named it functions.php and then copy the code to change the excerpt length but nothing changed. I want the excerpt to show only the title and the featured image so i changed all the numbers (32-20-50) to 1... but nothing change. Is there anything i misunderstood ? Thank you again for your interest

    link to my site here

  7. julesjunction
    Member
    Posted 1 year ago #

    I wanted the excerpt to show only the title and the featured image, no text, so used the following css in the 'Your custom CSS' box under the theme options layout section.

    .entry-summary p {
    display:none;
    }

  8. bgiannak
    Member
    Posted 1 year ago #

    It was so easy ????? THANK U so much julesjunction ! Everything is OK now....Really helpfull comment.

    Solved :P

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.