Maxbuttons, which outputs HTML through a shortcode cannot run another shortcode. But you can copy the CSS generated for a Maxbuttons into your style sheet and copy the HTML generated by the shortcode and put it in your page or post and then put the shortocode in the href attribute of the a tag:
<a href="[example-shortcode]">button text</a>.
Alan
Hi Alan,
Thanks I will take a look into that.
Hi AlanP57,
I am having exactly the same issue.
I need a Maxbutton on the sidebar, to grab a types shortcode with different details depending on the page loaded.
So I tried the following which didn’t work:
[maxbutton id="1" url="http://holidays.apollonia.com.cy/?page_id=4950&roomthumb=[types field="roomthumb" output="raw"][/types]&roomtype=[types field="apartment-type" output="raw"][/types]"]
I don’t quite understood your “CSS generated for a Maxbutton” advice,
can you please guide me to the right direction?
Hi Elis,
A shortcode inside a shortcode is not going to work in this way.
What Alan said was to copy all the CSS code of the button to your own CSS files ( or to ‘custom CSS’ if your theme supports that ). Then you can manually make a link and make it look like the button your made. This all requires some work though.
The other option is to get the image you are trying to get in a different way. That probably will require some coding.
Another possibility since the new release ( 3.18 – released today ) is to add a custom filter hook to the URL and do your shortcoding there.
It’s a bit advanced, but like so:
add_filter('mb-url-<buttonid>', function ($url) {
return $url;
}) ;
Inside that function you can use the function do_shortcode to add values to your url. <buttonid> is the id of the button you want to change.