[resolved] Twenty Twelve not displaying summary or manual posts excerpts (39 posts)

  1. Michael
    Part-Time Forum Moderator
    Posted 2 years ago #

    changing the excerpt length works (for me) with this functions.php in a child theme of Twenty Twelve:


    as you seem to have Dreamweaver at hand, I would suggest to use it all the time as the editor to change any WordPress templates or files (and for the FTP connection) (this is what I do) instead of using any other text editor.

  2. dianabyron
    Posted 2 years ago #

    I'll give that a go, thanks.
    Although I have Dreamweaver, I tend to only use it to see line numbers.
    I can't enlarge the text, can't zoom in, can't colour it, and I find it a strain on the eyes trying to read it. Whereas TextEdit gives me all those functions. I will just have to keep an unedited copy that I can open in Dreamweaver when I need to, and use this one to make the final changes and upload.

  3. dianabyron
    Posted 2 years ago #

    I just used your code from the pastebin (the second one, as the first one looked like mine), and got:

    Parse error: syntax error, unexpected T_FUNCTION in /home/diann/public_html/wp-content/themes/twentytwelve-child/functions.php on line 8


  4. dianabyron
    Posted 2 years ago #

    YES! I took your suggestion, and made a new Dreamweaver file with the same code in it, uploaded that, and bingo! I got my 100-word excerpt length.
    Alchymyth, big thanks for sticking with me and guiding me on this journey!

  5. dianabyron
    Posted 2 years ago #

    I spoke too soon.... some weird characters have appeared in my widget.... got to do a full checkup now....

  6. dianabyron
    Posted 2 years ago #

    What it seems to have done is taken away the website title from being displayed on the browser tab.... which is a pest....Can't imagine why a change to excerpt length on functions.php should mess with the browser tab title!

  7. dianabyron
    Posted 2 years ago #

    Found it. Dreamweaver had added a bunch of html crap after the closing tag about the title being called Untitled. So I deleted that, and now it looks good.

  8. Makc
    Posted 2 years ago #

    My way:
    1. Add new functions to functions.php file:

    function new_excerpt_length($length) {
    	return 55;
    add_filter('excerpt_length', 'new_excerpt_length');
    function new_excerpt_more($post) {
    	return ' <a>ID) . '">'
    	. 'Read more...' . '</a>'; }
    add_filter('excerpt_more', 'new_excerpt_more');

    2. change content.php
    is_search() -> !is_single()
    <?php if ( is_search() ) : // Only display Excerpts for Search ?>
    <?php if ( !is_single() ) : // Only display Excerpts for Search ?>

  9. emcarnahan756
    Posted 2 years ago #

    Thank you so much for your is_home solution! This has allowed me to have excerpts on the front page but leave the RSS feed full content.

    I searched for a solution to this in order to get a full article to display in a MailChimp email—just tested it and it works perfectly in that setting! Which I am mentioning here in case anyone else is struggling with that specifically—may it help them as well!
    Cheers all!
    Ellen :)

Topic Closed

This topic has been closed to new replies.

About this Topic