Title: MaxButtons doesn&#039;t work in widget
Last modified: September 1, 2016

---

# MaxButtons doesn't work in widget

 *  Resolved [vrackfall](https://wordpress.org/support/users/vrackfall/)
 * (@vrackfall)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/maxbuttons-doesnt-work-in-widget/)
 * Hi, I tried many times by different way to use an maxbutton with php inside an
   widget but nothing worked. I think I should do it like that :
    <?php echo do_shortcode(‘[
   maxbutton name=”my-button”]’);?>
 * Each time, I’m receiving this error message :
    Parse error: syntax error, unexpected‘
   mb’ (T_STRING), expecting ‘,’ or ‘;’ in /home/u259947457/public_html/fr/wp-content/
   plugins/php-text-widget/plugin.php(18) : eval()’d code on line 19
 * [https://wordpress.org/plugins/maxbuttons/](https://wordpress.org/plugins/maxbuttons/)

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

 *  Thread Starter [vrackfall](https://wordpress.org/support/users/vrackfall/)
 * (@vrackfall)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/maxbuttons-doesnt-work-in-widget/#post-7516812)
 * Please reply
 *  Plugin Author [maxfoundry](https://wordpress.org/support/users/maxfoundry/)
 * (@maxfoundry)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/maxbuttons-doesnt-work-in-widget/#post-7516813)
 * It’s the weekend. As it says in our description we’re off on the weekends. We’re
   be on it first thing Monday. Sorry.
 *  Plugin Author [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * (@basszje)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/maxbuttons-doesnt-work-in-widget/#post-7516828)
 * You should not use PHP within a text widget. You can just add the shortcode and
   it should work, at least with the default WP text widget it does.
 * Also the error message seems to be related to something else then your code example(
   there is no ‘mb’ in your example) .
 *  Thread Starter [vrackfall](https://wordpress.org/support/users/vrackfall/)
 * (@vrackfall)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/maxbuttons-doesnt-work-in-widget/#post-7516857)
 * Oh yeah, sorry, sorry for disturbing you during the weekend.
    (reply during the
   week, as you wan’t) Coming back to problem, there is no mb in my code too, but
   I think mb means “MaxButtons”. Also I enabled php and shortcodes in the text 
   widget by another way than above, by modifying the functions.php of my theme.
   But I’m getting almost the same error message, “Parse error: syntax error, unexpected‘
   mb’ (T_STRING), expecting ‘,’ or ‘;’ in”, it’s just the files listed after which
   are different.
 * Why I need to use MaxButtons inside php is because that this button should appear
   that only under a certain condition (with the if boolean of php).
 *  Thread Starter [vrackfall](https://wordpress.org/support/users/vrackfall/)
 * (@vrackfall)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/maxbuttons-doesnt-work-in-widget/#post-7516860)
 * Finally worked : I put the do_shortcode(‘[maxbutton id=”1″]’)
    into something
   like that : $button = do_shortcode(‘[maxbutton id=”1″]’); and I did somtehing
   like that after : echo $button . ‘‘;
 * So thanks for the help
 * Good weekend
 * -vrack

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

The topic ‘MaxButtons doesn't work in widget’ is closed to new replies.

 * ![](https://ps.w.org/maxbuttons/assets/icon-128x128.png?rev=1378636)
 * [MaxButtons - Create buttons](https://wordpress.org/plugins/maxbuttons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/maxbuttons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/maxbuttons/)
 * [Active Topics](https://wordpress.org/support/plugin/maxbuttons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/maxbuttons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/maxbuttons/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [vrackfall](https://wordpress.org/support/users/vrackfall/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/maxbuttons-doesnt-work-in-widget/#post-7516860)
 * Status: resolved