Below, you’ll find a detailed guide on how to add the MailChimp Forms by MailMunch Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the MailChimp Forms by MailMunch Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the MailChimp Forms by MailMunch Plugin and the shortcodes it provides:
"MailChimp Forms by MailMunch is a dynamic WordPress plugin that allows seamless integration of MailChimp forms into your site. It helps boost user engagement and grow your mailing list efficiently."
- [mailmunch-form]
MailChimp Forms by MailMunch [mailmunch-form] Shortcode
The Mailchimp-Forms-by-Mailmunch shortcode is a tool that enables you to embed a Mailchimp form into your WordPress site. This shortcode retrieves a specific Mailchimp form using its unique ID, which must be provided in the ‘id’ attribute. The form is then displayed within a div element, with its visibility set to ‘none’ to ensure it’s hidden until called upon. This allows for a seamless integration of your Mailchimp forms into your WordPress site.
Shortcode: [mailmunch-form]
Parameters
Here is a list of all possible mailmunch-form shortcode parameters and attributes:
id
– It’s the unique identifier for each individual form.
Examples and Usage
Basic example – Displays a MailMunch form using the form’s unique ID.
[mailmunch-form id=1 /]
PHP Function Code
In case you have difficulties debugging what causing issues with [mailmunch-form]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('mailmunch-form', array($this, 'shortcode_form'));
Shortcode PHP function:
function shortcode_form($atts) {
return "<div class='mailmunch-forms-short-code mailmunch-forms-widget-".$atts['id']."' style='display: none !important;'></div>";
}
Code file location:
mailchimp-forms-by-mailmunch/mailchimp-forms-by-mailmunch/public/class-mailchimp-mailmunch-public.php
Conclusion
Now that you’ve learned how to embed the MailChimp Forms by MailMunch Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply