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
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...
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?
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
JDorrian
Member
Posted 2 years ago #
thanks, I'm sure I'll have a load more sill questions :)