Title: [Plugin: Special Recent Posts] Unknown code error in template
Last modified: August 20, 2016

---

# [Plugin: Special Recent Posts] Unknown code error in template

 *  Resolved [xrun](https://wordpress.org/support/users/xrun/)
 * (@xrun)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-special-recent-posts-unknown-code-error-in-template/)
 * Hi.
    I’m trying to add SRP to my template, showing in a 2 by 4 layout where SRP
   fills a row left to right before continuing on the next row below. I need it 
   to get the posts from cat 82, to determine how many posts are in the cat, and
   to increase the SRP post offset by 1 after showing a post. It needs to keep making
   new rows until it has displayed 8 posts. That should result in a table 4 rows
   high.
 * I belive I’m getting close to a solution for this, but it seems I’m getting a
   PHP error on the line containing endwhile; endif;.
    Would someone be so kind 
   and have a look at this and lend a hand?
 *     ```
       <?php //Get post count and set offsetcount to 0
       $count = get_category(82)->count ; $offsetcount= 0 ; ?>
   
       <tbody><table><tr>
       <?php //Start and loop query while cat has posts and number of shown posts are less than 8, place it in 2 table columns
       	if(($offsetcount < 8) && ($offsetcount < $count)) : while (($offsetcount < 8) && ($offsetcount < $count)) { ?>
       <td style="width: 50%;" align="left" valign="top">
   
       <?php
       // Defining SRP options.
       $args = array(
           'srp_number_post_option'  => 1,
           'srp_thumbnail_option'    => 'yes',
           'srp_thumbnail_wdg_width' => '200',
           'srp_thumbnail_wdg_height' => '140',
           'srp_title_hide' => 'yes',
           'srp_wdg_excerpt_length_mode' => 'chars',
           'srp_wdg_excerpt_length' => '230',
           'srp_filter_cat_option' => '82',
           'srp_wdg_excerpt_length' => '230',
           'srp_post_global_offset_option' => $offsetcount,
           'srp_wdg_excerpt_length' => '230',
       );
       		if(function_exists('special_recent_posts')) {
       			special_recent_posts($args);
       		};
       ?>
       <?php //Add 1 to offsetcount before closing table column
       $offsetcount = $offsetcount + 1 ;  ?>
       </td>
       <?php	    endwhile; endif; ?>
       </tr></tbody></table>
       ```
   
 * [http://wordpress.org/extend/plugins/special-recent-posts/](http://wordpress.org/extend/plugins/special-recent-posts/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Luca Grandicelli](https://wordpress.org/support/users/lgrandicelli/)
 * (@lgrandicelli)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-special-recent-posts-unknown-code-error-in-template/#post-2326599)
 * If you get the PRO version, multi-column layout is available with no more effort.
 *  Thread Starter [xrun](https://wordpress.org/support/users/xrun/)
 * (@xrun)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-special-recent-posts-unknown-code-error-in-template/#post-2326631)
 * Yes, I asked you about multi-column support here 3 days ago:
    [Special Recent Posts PRO – Comments](http://codecanyon.net/item/special-recent-posts-pro/discussion/552356)
 * Your reply was that SRP PRO fills up every row in one column first, before continuing
   to the next column. I need it to fill every column in a row first, before moving
   down to the next row. So where you have multicolumn support which prioritizes
   the column, I need multirow support to prioritize the row for this project.
    
   May seem like the same thing, but when your viewing recent projects in a 2×4 
   layout then the post next to last may look like nr. 5 because it gets put in 
   the first column in the second row, and the last page would not have contents
   in its full width until the last column gets filled up. Of course you may work
   around that with offset, but then you’d be back to using several instances again,
   like I’m working on here.
 * You also told me that it does not support pagination at the moment. I’m actually
   working on some code that might add pagination support to SRP PRO when it is 
   finished. For now though, I just need to finish the work started in the code 
   above.
 * It is a very nice plugin, but it doesn’t do exactly what is needed for my friends
   page yet, so I’m trying to work it out.
 * BTW: having gotten some sleep since the first post above here, I realize exerpt
   length is defined three times.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Special Recent Posts] Unknown code error in template’ is closed
to new replies.

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

 * 2 replies
 * 2 participants
 * Last reply from: [xrun](https://wordpress.org/support/users/xrun/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-special-recent-posts-unknown-code-error-in-template/#post-2326631)
 * Status: resolved