wordpress coders

Nauthiz666

Senior Member
Joined
Nov 14, 2008
Messages
875
Reaction score
86
Can anyone give me a code i can insert into my single.php to make the full posts a excerpt as well? One that i could define in length parameter. Can't quite figure this out. (perferably without stripping images or anything else)
 
Last edited:
Try this:
- Install Advanced Excerpt Plugin

In single.php replace
Code:
the_content('');
with (replace xx with number of words):
Code:
the_advanced_excerpt('length=xx&use_words=1');
 
Try this:
- Install Advanced Excerpt Plugin

In single.php replace
Code:
the_content('');
with (replace xx with number of words):
Code:
the_advanced_excerpt('length=xx&use_words=1');

awesome i will give this a try
 
so where it says <?php the_content('Read more »'); ?>

replace it to <?php the_advanced_excerpt('length=xx&use_words=1'); ?>

???

i replaced xx to50, but all it did was wipe out all the words.
 
Last edited:
Yes, replace it with:
Code:
<?php the_advanced_excerpt('length=xx&use_words=1'); ?>

But change length=xx to number of words you want to have exp. length=40

i replaced xx to50, but all it did was wipe out all the words.
That's strange, I'm using it like this and it's working fine.
 
Last edited:
In this code you still have length=xx, did you installed and activated Advanced Excerpt plugin ?
 
In this code you still have length=xx, did you installed and activated Advanced Excerpt plugin ?

yeah it is working too. I tried doing the same code change on index.php and it worked, but when i did it on single.php it just wiped out the content. plus the length i adjusted to is 50.
 
Last edited:
in index.php and single.php you can just replace
Code:
<?php the_content('Read more »'); ?>

with

Code:
<?php the_excerpt('Read more »'); ?>

without installing any pluggins
 
Question: I'm trying to get this to work with another plugin... however when using <?php content('# of words to show'); ?> it messes up my theme because of the image I guess... I can only use excerpt without it messing up the theme, even default theme.

Does this plugin allow me to post an image and a certain # of words from content and link to the whole article without messing up the template? I don't have time atm because of exams to test this out! Thanks!
 
bump, i still cannot get single.php to be an excerpt also, ive tried new themes etc. Can anyone tell me how i can make my regular single.php posts also a slightly longer excerpt. Nevermind i got it, looks like it did have to do with the theme
 
Last edited:
Back
Top