• I have been interchanging these with no effect. The problem is there are several, at least 3, places in loop.php that say “the_excerpt” or “the_content”, and the basic explanations in the Codex don’t seem to distinguish these (that I can find).

    I want to display the excerpt on the Category page, and be able to modify “Continue Reading…”, and length of the except.

    (I know about the <!–more–> tag but would like to avoid that for now)

    Additionally or as an aside, I added the Excerpt Length plugin for Settings > Reading. You can specify the number of characters. But this has had no effect either, maybe it’s only for certain posts?

    Thank you very much for some help!

Viewing 12 replies - 1 through 12 (of 12 total)
  • What theme are you using/modifying?

    what theme?

    there is a limited amount of files in a theme; you might need to edit one of the less obvious.

    you can use https://codex.www.ads-software.com/Template_Hierarchy to find the generally right template.

    there are several, at least 3, places in loop.php

    My money is on Twenty Ten.

    Thread Starter Chris

    (@forumusr)

    You’re right!

    Twentyten.

    It was the 3 Loops in loop.php that gave you away. ??

    Bad news first: don’t edit the Twenty Ten theme. Instead create a child theme for your customisations.

    Once your child theme is active, create a category.php file in the child theme that just contains a single Loop that incorporates <?php the_content();?>. Then you can use the<!--more--> tag in each post to determine where the post teaser should end on the category page.

    Thread Starter Chris

    (@forumusr)

    Ok thanks. I have already have a child theme with a functions and css file.

    …contains a single Loop that incorporates <?php the_content();?>…

    So what exactly would that look like? I could hunt and peck for an hour or more to decipher and utilize what you mean exactly, but could you just provide something I could cut and paste it would be appreciated.
    I’m doing pretty well gradually learning the WP back end, short of total programming immersion…

    Thank you.

    Untested but something like https://pastebin.com/MNPkEBe6 should work.

    Thread Starter Chris

    (@forumusr)

    Thank you but, ok, this is where seemingly straightforward becomes annoyingly tedious…

    a) That’s a lot of code. It’s necessary to copy that entire 60 lines into the new category.php file?

    – I thought you could just swap “php the_content()” for “php the_excerpt()”?

    b) The line: “<?php the_content();?>” is not even in that code.

    I know you’re all programmers and you can summarize and abbreviate suggestions, but for a non-programmer it only leads to more questions and problems. Please be explicit.

    Isn’t there some simple checkbox somewhere in the admin area for excerpt/full posts, so you don’t have to get into all this for such a simple task?

    Hmmmm. Thanks.

    a) Yes. This is a child theme. so unless you use the full code in the relevant template, it won’t work.

    b) Yes it is. See Line 29.

    Thread Starter Chris

    (@forumusr)

    Ok thank you, my bad. I added that code to a category.php files which I copied into the child theme directory.

    On the posts page of the site I go this error:

    Parse error: syntax error, unexpected $end in /home/content/20/7343020/html/wp-content/themes/twenty-ten-child/category.php on line 61

    that’s the last line.

    This code is out of my skill set to troubleshoot this right now.
    Thanks!

    Thread Starter Chris

    (@forumusr)

    Does the category file need some kind of opening and closing code for the file itself, separate and additional to the above mentioned/linked code?

    The full, tested, template code is at https://pastebin.com/5MtsXN6H

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘the_excerpt and the_content’ is closed to new replies.