Title: Shortcode problem fix
Last modified: May 3, 2017

---

# Shortcode problem fix

 *  Resolved [PG](https://wordpress.org/support/users/parulgarg2/)
 * (@parulgarg2)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/shortcode-problem-fix/)
 * Hi
 * I needed to use the shortcode feature of this plugin, I tried but for some reasons
   I noticed boolean values were not working. Example, When I was setting thumb=’
   false’, it didn’t work.
 * So, i made this amendment into a file that helped. Just posting so that it may
   help others too.
 * In file /includes/shortcode.php
    Replace rpwe_shortcode method with the following
 *     ```
       function rpwe_shortcode( $atts, $content ) {
       	if ( isset( $atts['cssid'] ) ) {
       		$atts['cssID'] = $atts['cssid'];
       		unset( $atts['cssid'] );
       	}
       	if( isset ($atts['thumb'] ) ){
       		$atts['thumb'] = $atts['thumb'] === 'true' ? true: false;
       	}
       	if( isset ($atts['excerpt'] ) ){
       		$atts['excerpt'] = $atts['excerpt'] === 'true' ? true: false;
       	}
       	if( isset ($atts['date'] ) ){
       		$atts['date'] = $atts['date'] === 'true' ? true: false;
       	}
       	if( isset ($atts['date_relative'] ) ){
       		$atts['date_relative'] = $atts['date_relative'] === 'true' ? true: false;
       	}
       	if( isset ($atts['date_modified'] ) ){
       		$atts['date_modified'] = $atts['date_modified'] === 'true' ? true: false;
       	}
       	if( isset ($atts['readmore'] ) ){
       		$atts['readmore'] = $atts['readmore'] === 'true' ? true: false;
       	}
       	if( isset ($atts['comment_count'] ) ){
       		$atts['comment_count'] = $atts['comment_count'] === 'true' ? true: false;
       	}
       	if( isset ($atts['styles_default'] ) ){
       		$atts['styles_default'] = $atts['styles_default'] === 'true' ? true: false;
       	}
   
       	$args = shortcode_atts( rpwe_get_default_args(), $atts );
       	return rpwe_get_recent_posts( $args );
       }
       add_shortcode( 'rpwe', 'rpwe_shortcode' );
       ```
   

The topic ‘Shortcode problem fix’ is closed to new replies.

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

 * 0 replies
 * 1 participant
 * Last reply from: [PG](https://wordpress.org/support/users/parulgarg2/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/shortcode-problem-fix/)
 * Status: resolved