-
AuthorPosts
-
February 21, 2017 at 12:11 pm #749889
Hi,
I’ve found this in your documentation:
at the bottom:
MailChimp Newsletter Widget/Element
Now to include the MailChimp Signup in your site you have a range of options depending on where and how you want to include it:
….
As a Shortcode (Magic Wand tool > Mailchimp Signup): this will generate a [shortcode] that can be used in conjunction with do_shortcode if you need to include it on a custom PHP template or hook.As I’m not very familiar with PHP, could you please show me an example of how this code snippet for such a shortcode should look like, if I would like to add it in a theme file like the loop-index.php? I don’t understand this part “… in conjunction with do_shortcode …” as mentioned in the documentation.
Thank you.February 24, 2017 at 4:19 am #751199Hey Chris,
The mailchimp signup shortcode looks like this:
[av_mailchimp list='' double_opt_in='true' on_send='text' sent='Thank you for subscribing to our newsletter!' link='' color='' hide_labels=''][/av_mailchimp]
When adding it to some php files your code should look like this:
echo do_shortcode("[av_mailchimp list='' double_opt_in='true' on_send='text' sent='Thank you for subscribing to our newsletter!' link='' color='' hide_labels=''][/av_mailchimp]");
Hope this helps.
Best regards,
NikkoApril 11, 2017 at 12:03 pm #775963What part in shortcode is for redirect? data-avia-redirect=””
<form class=”avia_ajax_form av-form-labels-hidden avia-mailchimp-form” action=”” method=”post” data-av-custom-send=”mailchimp_send” data-avia-form-id=”2″ data-avia-redirect=””>
[av_mailchimp list='' double_opt_in='true' on_send='text' sent='Thank you for subscribing to our newsletter!' link='' color='' hide_labels=''][/av_mailchimp]
Because on widget area you cant use mailchimp widget and set redirection, that option isnt added.
Thank you
April 17, 2017 at 6:34 am #778559Hi,
Sorry for the late response, the shortcode would look like this:
[av_mailchimp list='1b64329f72' double_opt_in='aviaTBdouble_opt_in' on_send='redirect' sent='Thank you for subscribing to our newsletter!' link='manually,http://www.test.com' color='' custom_class=''] [av_mailchimp_field id='0' label='Email Address' type='text' value='' disabled='' check='is_email'][/av_mailchimp_field] [av_mailchimp_field id='1' label='First Name' type='text' value='' disabled='' check=''][/av_mailchimp_field] [av_mailchimp_field id='2' label='Last Name' type='text' value='' disabled='' check=''][/av_mailchimp_field] [av_mailchimp_field id='av-button' label='Subscribe' type='button' value='' check=''][/av_mailchimp_field] [/av_mailchimp]
or https://pastebin.com/880B84Hc
this part of the shortcode is what makes it redirect:
link='manually,http://www.test.com'
You can get the shortcode by adding this code in functions.php:
add_action('avia_builder_mode', "builder_set_debug"); function builder_set_debug() { return "debug"; }
and create a new page and use Mailchimp Signup, put the proper configuration/settings so shortcode will add code based on what you set. Below The Content Section, you should see the shortcode and just copy and paste it.
Best regards,
NikkoDecember 9, 2017 at 6:59 am #886728A late Thanks!
Yes thats correct shortcode. Mailchimp widget dont have redirect options. Thats option only in Avia builder. But its easy to include one more field in functions-enfold.php so widget has that field too.
December 9, 2017 at 8:33 am #886738Hi,
Yes, you can use the shortcode combined with a text widget.
Best regards,
Nikko -
AuthorPosts
- You must be logged in to reply to this topic.