Mailchimp Subscribe Sm Shortcodes

Below, you’ll find a detailed guide on how to add the Mailchimp Subscribe Sm Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Mailchimp Subscribe Sm Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Mailchimp Subscribe Sm Plugin and the shortcodes it provides:

Plugin Icon
MailChimp Subscribe Form, Optin Builder, PopUp Builder, Form Builder

"MailChimp Subscribe Form, Optin Builder, PopUp Builder, Form Builder is a versatile plugin that allows seamless integration with MailChimp. It provides tools to create subscribe forms, engaging pop-ups, and customized forms."

★★★★✩ (65) Active Installs: 4000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [pluginops_form]
  • [pluginops_popup_form]
  • [pluginops_flyin_form]
  • [pluginops_bar_form]
  • [pluginops_full_page_form]
  • [pb_samlple_nav]

Mailchimp Subscribe Sm [pluginops_form] Shortcode

The ‘pluginops_form’ shortcode from the Mailchimp-Subscribe-SM plugin is used to display a specific form template. This shortcode calls the ‘smfb_template_shortcode’ function, which extracts the ‘template_id’ attribute from the shortcode. It then checks if the PluginOps Optin Builder is active and, if true, includes the specified form template. If the plugin is not active, it displays an error message.

Shortcode: [pluginops_form]

Parameters

Here is a list of all possible pluginops_form shortcode parameters and attributes:

  • template_id – Specifies the unique ID of the form template

Examples and Usage

Basic example – The shortcode below is used to display a form template by referencing its ID. The template_id parameter is used to specify the ID of the desired form template.

[pluginops_form template_id=1 /]

Advanced examples

Using the shortcode to display multiple form templates by referencing their IDs. In this case, the form templates with IDs 1, 2, and 3 will be displayed. This can be useful when you want to display multiple forms on a single page.

[pluginops_form template_id=1 /]
[pluginops_form template_id=2 /]
[pluginops_form template_id=3 /]

It’s important to note that the pluginops_form shortcode will only work if the PluginOps Optin Builder plugin is active. If the plugin is not active, the shortcode will display the message “PluginOps Optin Builder is not active”.

PHP Function Code

In case you have difficulties debugging what causing issues with [pluginops_form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pluginops_form', array($this, 'smfb_template_shortcode') ) ;

Shortcode PHP function:

function smfb_template_shortcode($atts, $content){
   ob_start();
    
	  extract( shortcode_atts( array(

			'template_id' => '',
		), $atts ) );

	$template_id = $template_id;
	$showFormOn  =  'all';
	
	
	$isShortCodeTemplate = true;

	if (defined('SMFB_PLUGIN_PATH')) {
		
		if (! is_admin()) {
			include SMFB_PLUGIN_PATH.'public/templates/template.php';
		}

	}else{
		echo "PluginOps Optin Builder is not active";
	}
	

   return ob_get_clean();

}

Code file location:

mailchimp-subscribe-sm/mailchimp-subscribe-sm/admin/classes/admin.php

Mailchimp Subscribe Sm [pluginops_popup_form] Shortcode

The ‘pluginops_popup_form’ shortcode from the PluginOps Optin Builder plugin allows you to create and customize a popup form. This shortcode uses parameters like ‘template_id’, ‘delay’, ‘onscroll’, ‘onexit’, and ‘onclick’ to control the form’s behavior. For instance, you can set a delay before the form appears, or make it appear when the user scrolls or tries to exit the page. Note: If the PluginOps Optin Builder is not active, the shortcode will display an error message.

Shortcode: [pluginops_popup_form]

Parameters

Here is a list of all possible pluginops_popup_form shortcode parameters and attributes:

  • template_id – Specifies the unique ID of the template.
  • delay – Sets a delay before the form pops up.
  • onscroll – Triggers the form to appear when scrolling.
  • onexit – Makes the form pop up when user exits the page.
  • onclick – Displays the form when a user clicks on the page.

Examples and Usage

Basic example – The shortcode below triggers a popup form with the template id of 123.

[pluginops_popup_form template_id=123 /]

Advanced examples

Here, the shortcode will trigger a popup form with a delay of 5 seconds. The form uses the template id 123.

[pluginops_popup_form template_id=123 delay=5 /]

In this example, the shortcode will trigger a popup form when the user scrolls down the page. The form uses the template id 123.

[pluginops_popup_form template_id=123 onscroll=true /]

This shortcode will trigger a popup form when the user attempts to exit the page. The form uses the template id 123.

[pluginops_popup_form template_id=123 onexit=true /]

Finally, this shortcode will trigger a popup form when the user clicks on a specific element. The form uses the template id 123.

[pluginops_popup_form template_id=123 onclick=true /]

PHP Function Code

In case you have difficulties debugging what causing issues with [pluginops_popup_form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pluginops_popup_form', array($this, 'ulpb_template_popup_shortcode') ) ;

Shortcode PHP function:

function ulpb_template_popup_shortcode($atts, $content){
   ob_start();
    
	  extract( shortcode_atts( array(

			'template_id' => '',
			'delay'		  => '',
			'onscroll'	  => '',
			'onexit'	  => '',
			'onclick'	  => '',
			
		), $atts ) );

	$template_id = $template_id;
	$showFormOn  =  'all';
	$popupDisplayDelay = $delay;
	$popupDisplayOnScroll = $onscroll;
	$popupDisplayOnExit = $onexit;
	$popupDisplayOnClick = $onclick;
	
	
	$isShortCodeTemplate = true;
	$isPopUpTemplate = true;

	if (defined('SMFB_PLUGIN_PATH')) {
		
		if (! is_admin()) {
			include SMFB_PLUGIN_PATH.'public/templates/template.php';
		}

	}else{
		echo "PluginOps Optin Builder is not active";
	}
	

   return ob_get_clean();

}

Code file location:

mailchimp-subscribe-sm/mailchimp-subscribe-sm/admin/classes/admin.php

Mailchimp Subscribe Sm [pluginops_flyin_form] Shortcode

The Mailchimp-Subscribe-SM plugin shortcode, ‘pluginops_flyin_form’, is designed to display a fly-in form on your website. The shortcode takes parameters like ‘template_id’, ‘delay’, ‘onscroll’, ‘onexit’, ‘onclick’, and ‘position’ to customize the form’s behavior and position. If the PluginOps Optin Builder is inactive, it shows a message indicating the same.

Shortcode: [pluginops_flyin_form]

Parameters

Here is a list of all possible pluginops_flyin_form shortcode parameters and attributes:

  • template_id – Specifies the unique ID of the template to use.
  • delay – Sets the delay before the form appears, in seconds.
  • onscroll – Determines if the form appears when the user scrolls.
  • onexit – Determines if the form appears when the user is about to leave the page.
  • onclick – Determines if the form appears when the user clicks on a specific element.
  • position – Specifies the position of the form on the page (default is bottom right).

Examples and Usage

Basic example – A simple usage of the shortcode where we only specify the template_id parameter.

[pluginops_flyin_form template_id=1 /]

For advanced usage, we can specify multiple parameters to customize the behavior of the form. In the example below, we specify the template_id, delay, onscroll, onexit, onclick, and position parameters.

Advanced example – The shortcode is used to display a form that appears after a delay of 5 seconds, when the user scrolls to 50% of the page, or when the user tries to exit the page. The form appears at the bottom right of the page.

[pluginops_flyin_form template_id=1 delay=5 onscroll=50 onexit=true onclick=true position=bRight /]

Remember, the parameters are optional and if not specified, the plugin will use the default values. The template_id parameter is required to specify which form to display.

PHP Function Code

In case you have difficulties debugging what causing issues with [pluginops_flyin_form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pluginops_flyin_form', array($this, 'ulpb_template_popup_flyin_shortcode') ) ;

Shortcode PHP function:

function ulpb_template_popup_flyin_shortcode($atts, $content){
   ob_start();
    
	  extract( shortcode_atts( array(

			'template_id' => '',
			'delay'		  => '',
			'onscroll'	  => '',
			'onexit'	  => '',
			'onclick'	  => '',
			'position'	  => 'bRight',
			
		), $atts ) );

	$template_id = $template_id;
	$showFormOn  =  'all';
	$popupDisplayDelay = $delay;
	$popupDisplayOnScroll = $onscroll;
	$popupDisplayOnExit = $onexit;
	$popupDisplayOnClick = $onclick;
	$popupPosition = $position;

	
	
	$isShortCodeTemplate = true;
	$isPopUpFlyInTemplate = true;

	if (defined('SMFB_PLUGIN_PATH')) {
		
		if (! is_admin()) {
			include SMFB_PLUGIN_PATH.'public/templates/template.php';
		}

	}else{
		echo "PluginOps Optin Builder is not active";
	}
	

   return ob_get_clean();

}

Code file location:

mailchimp-subscribe-sm/mailchimp-subscribe-sm/admin/classes/admin.php

Mailchimp Subscribe Sm [pluginops_bar_form] Shortcode

The Mailchimp Subscribe SM Plugin shortcode is a powerful tool that triggers a subscription form. This shortcode uses parameters like ‘template_id’, ‘show_form_on’, ‘delay’, ‘onscroll’, ‘onexit’, ‘onclick’, and ‘position’ to customize the form’s behavior and appearance. It checks if the PluginOps Optin Builder is active and then displays the form accordingly. If not active, it alerts the user.

Shortcode: [pluginops_bar_form]

Parameters

Here is a list of all possible pluginops_bar_form shortcode parameters and attributes:

  • template_id – It’s the unique identifier of the template.
  • show_form_on – Decides where the form will display, default is ‘all’.
  • delay – Time delay before the form appears, in seconds.
  • onscroll – Form appears when user scrolls the page.
  • onexit – Form displays when user attempts to leave the page.
  • onclick – Form shows up when user clicks on a specific element.
  • position – Determines the location of the form on the page.

Examples and Usage

Basic example – Displays a popup bar with a default template.

[pluginops_bar_form template_id="1" /]

Advanced examples

Display a popup bar with a specific template, showing the form on all pages, with a delay of 5 seconds, after scrolling 50% of the page, on exit intent, and on click event.

[pluginops_bar_form template_id="1" show_form_on="all" delay="5" onscroll="50" onexit="true" onclick="true" /]

Display a popup bar with a specific template at a specific position (for example, at the bottom of the page).

[pluginops_bar_form template_id="1" position="bottom" /]

Display a popup bar with a specific template, showing the form only on specific pages, with a delay of 10 seconds, after scrolling 80% of the page, and on exit intent.

[pluginops_bar_form template_id="1" show_form_on="page" delay="10" onscroll="80" onexit="true" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [pluginops_bar_form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pluginops_bar_form', array($this, 'ulpb_template_popup_bar_shortcode') ) ;

Shortcode PHP function:

function ulpb_template_popup_bar_shortcode($atts, $content){
   ob_start();
    
	  extract( shortcode_atts( array(

			'template_id' => '',
			'show_form_on'=>'all',
			'delay'		  => '',
			'onscroll'	  => '',
			'onexit'	  => '',
			'onclick'	  => '',
			'position'	  => '',
			
		), $atts ) );

	$template_id = $template_id;
	$showFormOn  =  $show_form_on;
	$popupDisplayDelay = $delay;
	$popupDisplayOnScroll = $onscroll;
	$popupDisplayOnExit = $onexit;
	$popupDisplayOnClick = $onclick;
	$popupPosition = $position;

	
	
	$isShortCodeTemplate = true;
	$isPopUpBarTemplate = true;

	if (defined('SMFB_PLUGIN_PATH')) {
		
		if (! is_admin()) {
			include SMFB_PLUGIN_PATH.'public/templates/template.php';
		}

	}else{
		echo "PluginOps Optin Builder is not active";
	}
	

   return ob_get_clean();

}

Code file location:

mailchimp-subscribe-sm/mailchimp-subscribe-sm/admin/classes/admin.php

Mailchimp Subscribe Sm [pluginops_full_page_form] Shortcode

The ‘pluginops_full_page_form’ shortcode is a part of the Mailchimp-Subscribe-SM plugin. It enables the display of a full-page form on your WordPress site. This shortcode accepts parameters like ‘template_id’, ‘show_form_on’, ‘delay’, ‘onscroll’, ‘onexit’, and ‘onclick’. You can customize the form’s appearance and behavior based on these parameters. For instance, you can set a delay for the form to appear or configure it to pop up on scroll, exit, or click. Please note, this shortcode requires the PluginOps Optin Builder to be active. If not, it will display an error message.

Shortcode: [pluginops_full_page_form]

Parameters

Here is a list of all possible pluginops_full_page_form shortcode parameters and attributes:

  • template_id – Specifies the ID of the template to use.
  • show_form_on – Determines when the form should be displayed.
  • delay – Sets a delay before the form is displayed.
  • onscroll – Triggers the form when the user scrolls.
  • onexit – Triggers the form when the user attempts to exit.
  • onclick – Triggers the form when the user clicks.

Examples and Usage

Basic example – A simple usage of the shortcode to display a full page form with a specific template ID.

[pluginops_full_page_form template_id="1" /]

Advanced examples

Using the shortcode to display a full page form with a specific template ID, only on specific pages (for example, only on the ‘about’ page), with a delayed display of 5 seconds.

[pluginops_full_page_form template_id="1" show_form_on="about" delay="5" /]

Using the shortcode to display a full page form with a specific template ID, with a delayed display of 5 seconds, and also to trigger the form display when the user attempts to exit the page or when the user has scrolled down 50% of the page.

[pluginops_full_page_form template_id="1" delay="5" onexit="true" onscroll="50" /]

Using the shortcode to display a full page form with a specific template ID, to be displayed immediately when a specific element on the page is clicked (for example, a button with the ID ‘subscribe-now’).

[pluginops_full_page_form template_id="1" onclick="#subscribe-now" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [pluginops_full_page_form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pluginops_full_page_form', array($this, 'ulpb_template_popup_full_page_shortcode') ) ;

Shortcode PHP function:

function ulpb_template_popup_full_page_shortcode($atts, $content){
   ob_start();
    
	  extract( shortcode_atts( array(

			'template_id' => '',
			'show_form_on'=>'all',
			'delay'		  => '',
			'onscroll'	  => '',
			'onexit'	  => '',
			'onclick'	  => '',
			
		), $atts ) );

	$template_id = $template_id;
	$showFormOn  =  $show_form_on;
	$popupDisplayDelay = $delay;
	$popupDisplayOnScroll = $onscroll;
	$popupDisplayOnExit = $onexit;
	$popupDisplayOnClick = $onclick;

	
	
	$isShortCodeTemplate = true;
	$isPopUpFullPageTemplate = true;

	if (defined('SMFB_PLUGIN_PATH')) {
		
		if (! is_admin()) {
			include SMFB_PLUGIN_PATH.'public/templates/template.php';
		}

	}else{
		echo "PluginOps Optin Builder is not active";
	}
	

   return ob_get_clean();

}

Code file location:

mailchimp-subscribe-sm/mailchimp-subscribe-sm/admin/classes/admin.php

Mailchimp Subscribe Sm [pb_samlple_nav] Shortcode

The ‘pb_samlple_nav’ shortcode from the Mailchimp-subscribe-sm plugin is designed to generate custom navigation menus. It takes parameters like menu style, color, font, and size, and uses them to render the appropriate menu. The menu options are only accessible to users with ‘editor’ or ‘administrator’ roles. .

Shortcode: [pb_samlple_nav]

Parameters

Here is a list of all possible pb_samlple_nav shortcode parameters and attributes:

  • pb_menu – Name of the menu to display
  • pb_logo_url – URL of the logo to be displayed
  • menucolor – Color of the menu
  • menu_class – Style of the menu (menu-style-1, menu-style-2, menu-style-3, menu-style-4)
  • menu_font – Font used in the menu
  • menu_fonthovercolor – Color of the menu font on hover
  • menu_fonthoverbgcolor – Background color of the menu font on hover
  • menu_fontsize – Size of the menu font

Examples and Usage

Basic example – A simple usage of the shortcode to display a custom menu with default style.

[pb_samlple_nav pb_menu="Main Menu" /]

Advanced examples

1. Displaying a custom menu with a specific style and custom font size.

[pb_samlple_nav pb_menu="Main Menu" menu_class="menu-style-2" menu_fontsize="18px" /]

2. Displaying a custom menu with a specific style, custom logo URL, and custom menu color.

[pb_samlple_nav pb_menu="Main Menu" pb_logo_url="http://example.com/logo.png" menu_class="menu-style-3" menucolor="#333333" /]

3. Displaying a custom menu with specific style, custom font, and custom hover colors for font and background.

[pb_samlple_nav pb_menu="Main Menu" menu_class="menu-style-4" menu_font="Arial" menu_fonthovercolor="#ffffff" menu_fonthoverbgcolor="#000000" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [pb_samlple_nav] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'pb_samlple_nav', array($this,'pb_shortcode_sample_nav' ) );

Shortcode PHP function:

function pb_shortcode_sample_nav($atts, $content){
	if( current_user_can('editor') || current_user_can('administrator') ) {
	   ob_start();
	    
		  extract( shortcode_atts( array(

				'pb_menu' => '',
				'pb_logo_url' => '',
				'menucolor' => '',
				'menu_class' => '',
				'menu_font' => '',
				'menu_fonthovercolor' => '',
				'menu_fonthoverbgcolor' => '',
				'menu_fontsize' => '',
				
			), $atts ) );

		$menuName = $pb_menu;
		$pageLogoUrl = $pb_logo_url;
		$menuColor = $menucolor;
		$menufont = $menu_font;
		$menufontHoverColor = $menu_fonthovercolor;
		$menuFontHoverBgColor = $menu_fonthoverbgcolor;
		$menuFontSize = $menu_fontsize;

		switch ($menu_class) {
			case 'menu-style-1':
				include(SMFB_PLUGIN_PATH.'admin/views/menus/menu-style-1.php');
			break;
			case 'menu-style-2':
				include(SMFB_PLUGIN_PATH.'admin/views/menus/menu-style-2.php');
			break;
			case 'menu-style-3':
				include(SMFB_PLUGIN_PATH.'admin/views/menus/menu-style-3.php');
			break;
			case 'menu-style-4':
				include(SMFB_PLUGIN_PATH.'admin/views/menus/menu-style-4.php');
			break;
			default:
				include(SMFB_PLUGIN_PATH.'admin/views/menus/menu-style-1.php');
			break;
		}
		

		echo $this_widget_menu;
	   return ob_get_clean();

	}

}

Code file location:

mailchimp-subscribe-sm/mailchimp-subscribe-sm/admin/classes/admin.php

Conclusion

Now that you’ve learned how to embed the Mailchimp Subscribe Sm Plugin shortcodes, 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.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *