• Resolved vrackfall

    (@vrackfall)


    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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter vrackfall

    (@vrackfall)

    Please reply

    Plugin Author maxfoundry

    (@maxfoundry)

    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

    (@basszje)

    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

    (@vrackfall)

    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

    (@vrackfall)

    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.