wordpress coders

Discussion in 'Blogging' started by Nauthiz666, Mar 24, 2009.

  1. Nauthiz666

    Nauthiz666 Senior Member

    Joined:
    Nov 14, 2008
    Messages:
    874
    Likes Received:
    84
    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: Mar 24, 2009
  2. zielak

    zielak Registered Member

    Joined:
    Jan 13, 2009
    Messages:
    77
    Likes Received:
    30
    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');
     
  3. Nauthiz666

    Nauthiz666 Senior Member

    Joined:
    Nov 14, 2008
    Messages:
    874
    Likes Received:
    84
    awesome i will give this a try
     
  4. Nauthiz666

    Nauthiz666 Senior Member

    Joined:
    Nov 14, 2008
    Messages:
    874
    Likes Received:
    84
    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: Mar 24, 2009
  5. zielak

    zielak Registered Member

    Joined:
    Jan 13, 2009
    Messages:
    77
    Likes Received:
    30
    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

    That's strange, I'm using it like this and it's working fine.
     
    Last edited: Mar 24, 2009
  6. Nauthiz666

    Nauthiz666 Senior Member

    Joined:
    Nov 14, 2008
    Messages:
    874
    Likes Received:
    84
     
    Last edited: Mar 24, 2009
  7. zielak

    zielak Registered Member

    Joined:
    Jan 13, 2009
    Messages:
    77
    Likes Received:
    30
    In this code you still have length=xx, did you installed and activated Advanced Excerpt plugin ?
     
  8. Nauthiz666

    Nauthiz666 Senior Member

    Joined:
    Nov 14, 2008
    Messages:
    874
    Likes Received:
    84
    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: Mar 24, 2009
  9. zielak

    zielak Registered Member

    Joined:
    Jan 13, 2009
    Messages:
    77
    Likes Received:
    30
    Can you PM url of your site ?
     
  10. Nauthiz666

    Nauthiz666 Senior Member

    Joined:
    Nov 14, 2008
    Messages:
    874
    Likes Received:
    84
    yeah sure hold on
     
  11. sodacrates

    sodacrates Registered Member

    Joined:
    Jan 13, 2009
    Messages:
    66
    Likes Received:
    4
    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
     
  12. spankythepyro

    spankythepyro Power Member

    Joined:
    Mar 7, 2009
    Messages:
    572
    Likes Received:
    95
    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!
     
  13. Nauthiz666

    Nauthiz666 Senior Member

    Joined:
    Nov 14, 2008
    Messages:
    874
    Likes Received:
    84
    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: Mar 25, 2009