Forums

[resolved] Excerpt problems with Pinao Black template (5 posts)

  1. JDorrian
    Member
    Posted 2 years ago #

    Hi I'm new to wp and I'm having problems getting the excerpts to work on the template I'm using (Piano Black)

    I think i'm supposed to Replaces "the_content()" with

    <?php if ( is_category() || is_archive() ) {
    the_excerpt();
    } else {
    the_content();
    } ?>

    to display the excerpt when there is one and just to use the content when there's not.

    But what page do I modify? and how much of the content() do I discard?

    Thanks in advance

    John

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    You should just be able to use:

    <?php if ( is_archive() ) {
    the_excerpt();
    } else {
    the_content();
    } ?>

    as is_archive() will return true for Category, Tag, Author and Date based pages. You need to modify archive.php, catgeory.php & tag.php (if you have those template files) and index.php.

    how much of the content() do I discard?

    Sorry? Not sure I follow you...

  3. JDorrian
    Member
    Posted 2 years ago #

    Thanks,I've got a work round using the <!--more--> in the body of the post, and the excerpt works when searching the site although I would have preferred that when you click on each category that the excerpt is displayed instead of the article or part of it (using the <!--more-->)

    how much of the_content() do I discard

    what I ment by this is if you modify the_content() what parts do I change/replace, or is it just a case off adding the string of text in each of the 3/4 pages you mentioned above?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    You don't normally modify the_content() as such but you can insert the 'more link' text that you would like used.

    http://codex.wordpress.org/Template_Tags/the_content

  5. JDorrian
    Member
    Posted 2 years ago #

    thanks, I'm sure I'll have a load more sill questions :)

Topic Closed

This topic has been closed to new replies.

About this Topic