Title: You had a looping issue in shortcode-button.php
Last modified: August 21, 2016

---

# You had a looping issue in shortcode-button.php

 *  Resolved [inkblot600](https://wordpress.org/support/users/inkblot600/)
 * (@inkblot600)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/you-had-a-looping-issue-in-shortcode-buttonphp/)
 * When activating the plugin it produced a Fatal Error. What happened is you had
   a function shortcode_button() already declared and it was looping and trying 
   to create it again. I fixed it with the code below.
 * 1.Install plugin
    2.Edit plugin file shortcode-button.php with code below 3 Update
 *     ```
       if(!function_exists('shortcode_button'))
       {
          function shortcode_button($atts, $content = null){
       	$content = trim(do_shortcode(shortcode_unautop($content)));
       	extract(shortcode_atts(array("mode" => 'link', "href" => 'http://'), $atts));
       	switch ($mode) {
       		case 'down':
       			return '<span class="but-down"><a href="'.$href.'" target="_blank"><span>'.$content.'</span></a></span>';
       		break;
   
       		case 'heart':
       			return '<span class="but-heart"><a href="'.$href.'" target="_blank"><span>'.$content.'</span></a></span>';
       		break;
   
       		case 'link':
       			return '<span class="but-link"><a href="'.$href.'" target="_blank"><span>'.$content.'</span></a></span>';
       		break;
   
       		case 'doc':
       			return '<span class="but-document"><a href="'.$href.'" target="_blank"><span>'.$content.'</span></a></span>';
       		break;
   
       		default:
       			return '<a href="'.$href.'" target="_blank">'.$content.'</a>';
       		break;
       	}
           }
       }
       ```
   
 * [https://wordpress.org/plugins/shortcode-button/](https://wordpress.org/plugins/shortcode-button/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Arefly](https://wordpress.org/support/users/eflyjason/)
 * (@eflyjason)
 * [12 years ago](https://wordpress.org/support/topic/you-had-a-looping-issue-in-shortcode-buttonphp/#post-4849564)
 * Hi! Sorry for late reply! Plugin updated!

Viewing 1 replies (of 1 total)

The topic ‘You had a looping issue in shortcode-button.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-button_edcee8.svg)
 * [Shortcode Button](https://wordpress.org/plugins/shortcode-button/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-button/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-button/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-button/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-button/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-button/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Arefly](https://wordpress.org/support/users/eflyjason/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/you-had-a-looping-issue-in-shortcode-buttonphp/#post-4849564)
 * Status: resolved