Support » Fixing WordPress » Code for excerpt

  • Pankas

    (@pankas)


    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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi

    (@esmi)

    Forum Moderator

    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); ?>

    Pankas

    (@pankas)

    esmi,
    Is the line correct?

    esmi

    (@esmi)

    Forum Moderator

    No. Try:

    <?php the_excerpt();?>

    instead.

    Pankas

    (@pankas)

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

    esmi

    (@esmi)

    Forum Moderator

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

    Pankas

    (@pankas)

    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?

    Pankas

    (@pankas)

    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.

    esmi

    (@esmi)

    Forum Moderator

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Code for excerpt’ is closed to new replies.