WordPress.org

Forums

[resolved] Article Excerpts (18 posts)

  1. elric1984
    Member
    Posted 7 years ago #

    I'm having trouble making it so that only the excerpts of articles show on the category pages of my blog. As it is, the entire articles show. My blog is at http://www.nccg.info. Any detailed help would be appreciated, as I'm not entirely expert at coding. I used the WordPress Theme Generator (http://www.yvoschaap.com/wpthemegen/) to make my theme.

    -Derek

  2. miromiro
    Member
    Posted 7 years ago #

    Hi Derek,

    In your category.php page, replace

    <?php the_post(); ?>

    with

    <?php the_excerpt(); ?>

    See the excerpt for details.

  3. elric1984
    Member
    Posted 7 years ago #

    Hey, thanks for the help, but I looked at category.php and couldn't find the tag you mentioned. Its in wp-includes, right?

  4. whooami
    Member
    Posted 7 years ago #

    Hey, thanks for the help, but I looked at category.php and couldn't find the tag you mentioned. Its in wp-includes, right?

    no. you are supposed to be looking at the category.php that is inside your current theme's directory.

    if you dont have one, you will need to create one in order to accomplish what you are asking how to do.

  5. elric1984
    Member
    Posted 7 years ago #

    I don't have a category.php in my theme. Any ideas?

  6. miromiro
    Member
    Posted 7 years ago #

    You can just go ahead and create one:

    http://codex.wordpress.org/Category_Templates

    Don't worry, its not too painful :-)

  7. elric1984
    Member
    Posted 7 years ago #

    I have none of the files listed except for the index.php, the fourth one on the list. This is the code from my index.php. Any problems?
    -------------------------

    [Moderated: Too much code. Please consider placing the code in a text file on your site with a link here -or- use a pastebin service such as http://wordpress.pastebin.ca. Thanks!]

  8. Chris_K
    Member
    Posted 7 years ago #

    Just go ahead and copy it to category.php and run amuck :-)

  9. elric1984
    Member
    Posted 7 years ago #

    There is no category.php, though.

    Here is the code again, this time in a text file: http://www.nccg.info/indexphp.txt

  10. nolageek
    Member
    Posted 7 years ago #

    Create a new file called category.php and copy/paste all of the code from index.php into it. That template will now be used to list categories. Then, change the_post() to the_excerpt();

  11. elric1984
    Member
    Posted 7 years ago #

    I did precisely that and it made my category pages (in this screen shot, my "Update Log" category) look like this:

    http://www.nccg.info/categoryerror.jpg

  12. elric1984
    Member
    Posted 7 years ago #

    Hello?

  13. elric1984
    Member
    Posted 7 years ago #

    Is there any way I can perhaps pay someone to fix the problem and if so, what would it cost?

  14. miromiro
    Member
    Posted 7 years ago #

    Hi Derek,

    Try this: http://wordpress.pastebin.ca./705414

    Save this page as category.php - upload it and see how you go...

  15. elric1984
    Member
    Posted 7 years ago #

    Yes, it works! Thanks, I owe you one! So what exactly did you do? :D

  16. miromiro
    Member
    Posted 7 years ago #

    No problem - just compare what you have now with what you posted here:

    http://www.nccg.info/indexphp.txt

    Glad to help.

  17. nolageek
    Member
    Posted 7 years ago #

    miromiro,

    Out of curiosity - what did you change? I've been comparing the two for about 40 minutes now. heh.

  18. whooami
    Member
    Posted 7 years ago #

    theres one change:

    <?php the_excerpt (); ?>

    is now:

    <?php the_content('Read the rest of this entry &raquo;'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic