Support » Fixing WordPress » Post Excerpt – Echo script PHP Troubleshooting

  • TumbleweedMarketingAnalytics

    (@tumbleweedmarketinganalytics)


    1. This is the content output code in rotating_post.php file:

    echo "<div class='rp_post_content'>{$postContent}</div>\n";

    2. How do I wrap the following code around the above statment:

    <?php
      $excerpt = get_the_excerpt();
      echo string_limit_words($excerpt,25);
    ?>

    IF…. this is the code in my functions.php file:

    <?php
    function string_limit_words($string, $word_limit)
    {
      $words = explode(' ', $string, ($word_limit + 1));
      if(count($words) > $word_limit)
      array_pop($words);
      return implode(' ', $words);
    }
    ?>

    Thanks,

  • The topic ‘Post Excerpt – Echo script PHP Troubleshooting’ is closed to new replies.