WordPress.org

Ready to get started?Download WordPress

Forums

Code for excerpt (9 posts)

  1. Pankas
    Member
    Posted 4 years ago #

    I did modified the index.php. Here is the original code:
    <div class="art-PostContent">
    <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>

    I modified it to the following:
    <div class="art-PostContent">
    <?php if (is_search()) the_excerpt(); else the_excerpt_reloaded(100, '<img><div>', 'none', TRUE, '[Read More...]', TRUE); ?>

    However, I got the error message,
    Fatal error: Call to undefined function the_excerpt_reloaded() in /home/pankas/public_html/wp-content/themes/dcomputers/index.php on line 37

    Where can I find line 37? In my server? How do I go about it?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    It's this line in your theme's index.php file:
    <?php if (is_search()) the_excerpt(); else the_excerpt_reloaded(100, '<img><div>', 'none', TRUE, '[Read More...]', TRUE); ?>

  3. Pankas
    Member
    Posted 4 years ago #

    esmi,
    Is the line correct?

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    No. Try:

    <?php the_excerpt();?>

    instead.

  5. Pankas
    Member
    Posted 4 years ago #

    esmi,
    Can I display 100 words and let the reader click if he wants to continue reading?
    <?php the_excerpt(100, '[Read More...]');?>

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    Not without adding an extra function to your theme's functions.php file first. You might be better off using a custom excerpt plugin.

  7. Pankas
    Member
    Posted 4 years ago #

    esmi,
    Thanks for the code, <?php the_excerpt();?>. I tried it and it works fine, but I want add more to this.
    Now where can I find a custom excerpt plugin? Would the WP "excerpt editor" plugin do the job in this case?

  8. Pankas
    Member
    Posted 4 years ago #

    Thanks, esmi.
    Finally, I got it.
    I found that the WP "custom excerpts" works fine for me. I can control how many words to display.

  9. esmi
    Forum Moderator
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags