Title: Can&#8217;t render from shortcode [li_profile]
Last modified: August 14, 2017

---

# Can’t render from shortcode [li_profile]

 *  Resolved [wollsale](https://wordpress.org/support/users/wollsale/)
 * (@wollsale)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/cant-render-from-shortcode-li_profile/)
 * Hi,
 * I just installed this plugin for wordpress and I’m getting an error :
 * I properly install the plugin, register my app for the Linkedin API, get my token
   key which has been validated.
 * I wrote this shortcode in a random page : [li_profile] and when I reload this
   page, I get this error :
 * “_An exception has been thrown during the rendering of a template (“Undefined
   variable: atts”)_”
 * For this project, I’m using the **Themosis Framework**, but it’s not the problem,
   when I switch with a basic wordpress theme, I get the same issue.
 * Any ideas ?
 * Thanks in advance,
 * W.

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

 *  Plugin Author [Claude Vedovini](https://wordpress.org/support/users/cvedovini/)
 * (@cvedovini)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/cant-render-from-shortcode-li_profile/#post-9408630)
 * Hi,
 * If you Google that error you will see that is a Symphony error. It’s not related
   to the plugin.
 *  Thread Starter [wollsale](https://wordpress.org/support/users/wollsale/)
 * (@wollsale)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/cant-render-from-shortcode-li_profile/#post-9408692)
 * Thanks Claude,
 * I’m not familiar with php and twig development, I’ve been asked to add this plugin
   but I can’t understand where this error come from, I’ve installed some plugins
   and never had this problem before.
 * All I understand is that the variable $atts is not defined in plugins/wp-linkedin/
   wp-linkedin.php :285
 *     ```
       function wp_linkedin_profile($atts='') {
           $atts = wp_linkedin_shortcode_atts(array(
                       'fields' => LINKEDIN_FIELDS,
                       'lang' => LINKEDIN_PROFILELANGUAGE
                   // HERE
                   ), $atts, 'li_profile');
           extract($atts);
   
           $fields = preg_replace('/\s+/', '', LINKEDIN_FIELDS_BASIC . ',' . $fields);
           $profile = wp_linkedin_get_profile($fields, $lang);
   
           if (is_wp_error($profile)) {
               return wp_linkedin_error($profile);
           } elseif ($profile && is_object($profile)) {
               return wp_linkedin_load_template('profile',
                       array_merge($atts, array('profile' => $profile)));
           }
       }
       ```
   
 * but I’m following the instructions on the extension homepage.
 *  Plugin Author [Claude Vedovini](https://wordpress.org/support/users/cvedovini/)
 * (@cvedovini)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/cant-render-from-shortcode-li_profile/#post-9408938)
 * that error doesn’t make sense, that variable is defined just above, in the signature
   of the method
 *  Thread Starter [wollsale](https://wordpress.org/support/users/wollsale/)
 * (@wollsale)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/cant-render-from-shortcode-li_profile/#post-9415170)
 * Yep, it doesn’t make sense, but I’ve change something and now the error actually
   concerned the function at line 252+ :
 *     ```
       function wp_linkedin_shortcode_atts($pairs, $args, $shortcode) {
         $out = wp_parse_args($args, $pairs);
         if ($shortcode) {
           $out = apply_filters("shortcode_atts_{$shortcode}", $out, $pairs, $atts, $shortcode);
         }
   
         return $out;
       }
       ```
   
 * in `$out = apply_filters("shortcode_atts_{$shortcode}", $out, $pairs, $atts, 
   $shortcode);` the variable `$atts` wasn’t defined. So I defined it as an empty
   array and now the code works.
 *     ```
       function wp_linkedin_shortcode_atts($pairs, $args, $shortcode) {
       	$out = wp_parse_args($args, $pairs);
               // edit
       	$atts = array();
       	if ($shortcode) {
       		$out = apply_filters("shortcode_atts_{$shortcode}", $out, $pairs, $atts, $shortcode);
       	}
   
       	return $out;
       }
       ```
   
 * Themosis framework, and twig, prevented me from going further.
    -  This reply was modified 8 years, 9 months ago by [wollsale](https://wordpress.org/support/users/wollsale/).
    -  This reply was modified 8 years, 9 months ago by [wollsale](https://wordpress.org/support/users/wollsale/).
 *  Plugin Author [Claude Vedovini](https://wordpress.org/support/users/cvedovini/)
 * (@cvedovini)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/cant-render-from-shortcode-li_profile/#post-9415249)
 * I think you found a nice bug, but it’s not what you think 🙂
    I will release 
   a fix shortly

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

The topic ‘Can’t render from shortcode [li_profile]’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-linkedin_dddbdc.svg)
 * [WP LinkedIn](https://wordpress.org/plugins/wp-linkedin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-linkedin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-linkedin/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-linkedin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-linkedin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-linkedin/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Claude Vedovini](https://wordpress.org/support/users/cvedovini/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/cant-render-from-shortcode-li_profile/#post-9415249)
 * Status: resolved