[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>
The topic ‘[Plugin: Special Recent Posts] Unknown code error in template’ is closed to new replies.