• Resolved zeddcara

    (@zeddcara)


    Hi,

    Great theme and easy to custom.
    For SEO reason, I’ld like to have two different excerpts :
    1) “More balise” in homepage
    2) “Excerpt (the one to fill)” on category

    I was looking for the “the_content” somewhere in function.php but nothing.
    Any clue ?

    Best & thx in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi zeddcara. I’m not sure I understand your question. You want one type of excerpt for posts on the home page and another type of excerpt for posts on the category page? Can you explain that in a little more detail?

    The theme only uses “the_content” on the single post page. Other post displays use one of the three content files which include “the_excerpt”:
    content.php
    content-featured.php
    content-standard.php

    Thread Starter zeddcara

    (@zeddcara)

    Hi bdbrown and thx for reply.

    You want one type of excerpt for posts on the home page and another type of excerpt for posts on the category page?

    Exactly. One using the text before the <!more> balise, the other one with the excerpt area.

    Yes, concerning content & content-featured, I tried to substitute one possibility by the other (content<–>excerpt) but, in anycase, I still either everything before the “more” or with the “excerpt” area (if one looks category page and Homepage).

    What I would like is, for instance, the text before the “more” in the /home & the text in the “excerpt” area in category, to avoid duplicate content.

    Am I more clear ?

    Best,

    Did some research and came across this article. Modified it to work with your criteria and tested it; does what it says. Pretty slick. I copied the modified version up on Pastebin. Drop that into your child theme functions.php file and let me know how it works.

    Thread Starter zeddcara

    (@zeddcara)

    Hey,

    Thx for your help. It’s almost perfect. Two little changes (I am not a king in PHP, sorry).

    1°) Could we invert, and put the excerpt in home in categories and vice-versa ?
    2°) Could it be possible to remove the linked title after “Read More -” ? The link already exists with the “big” title.
    3°) In your modified code, isn’t the <?php missing at the very beginning ?

    Thx for all ??
    Kind regards,

    1) Yes.
    2) Yes. You can further modify the ‘Read More’ text by editing this line:

    $more_text = sprintf(
         __( 'Read More', 'themeslug' ),

    3) If you already have a functions.php file then the opening php tag would be the first thing in that file. If you’re creating a new file then, yes, you would need to include it.

    Updated code is on Pastebin.

    Thread Starter zeddcara

    (@zeddcara)

    Hi,

    Just … perfect :D. Nothing else matters ??

    You made my day.

    Thx for all

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘excerpt different in home & category’ is closed to new replies.