Title: Rotating Posts : Script &#8211; Excerpts
Last modified: August 20, 2016

---

# Rotating Posts : Script – Excerpts

 *  [TumbleweedMarketingAnalytics](https://wordpress.org/support/users/tumbleweedmarketinganalytics/)
 * (@tumbleweedmarketinganalytics)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/rotating-posts-script-excerpts/)
 * 1. This is the content output code in Mark Inderhees 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);
       }
       ?>
       ```
   
 * [http://wordpress.org/extend/plugins/rotating-posts/](http://wordpress.org/extend/plugins/rotating-posts/)

The topic ‘Rotating Posts : Script – Excerpts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/rotating-posts.svg)
 * [Rotating Posts](https://wordpress.org/plugins/rotating-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rotating-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rotating-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/rotating-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rotating-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rotating-posts/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [TumbleweedMarketingAnalytics](https://wordpress.org/support/users/tumbleweedmarketinganalytics/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/rotating-posts-script-excerpts/)
 * Status: not resolved