Skip to main content

Widget Control Module

Important

This module is not available for use with WordPress 5.8 or later for which widgets are created and edited using the WordPress Block Editor, previously known as Gutenberg.

Widget display conditions can be set as detailed within the ActiveMember360 Block Editor module.

If you wish to use this ActiveMember360 Widget Control module with WordPress 5.8 or later the WordPress plugin Classic Widgets must be installed and activated.

However please note that widget controls defined using the ActiveMember360 Widget Control module are not migrated to the ActiveMember360 Block Editor module and vice versa. They are two separate systems.

For thoses using WordPress 5.8 or later we would always recommend using the WordPress Block Editor and the ActiveMember360 Block Editor module to define and control the display of widgets.

Overview

When using ActiveMember360 you can dynamically control the visibility of any widget to personalize and segment your content.

ActiveMember360 Conditionals

WordPress widget visibility can be controlled by ActiveMember360 Conditionals based upon:

  • Contact list status:
    • Contact is active in any or all of the lists selected
    • Contact is unconfirmed in any or all of the lists selected
    • Contact is unsubscribed in any or all of the lists selected
    • Contact is bounced in any or all of the lists selected
  • Contact tag status:
    • Contact has any or all of the tags selected
    • Contact does not have any or all of the tags selected
  • Contact field comparison:
    • Contact has a contact field that compares with a value
    • Contact has a contact field that compares with another of their contact fields
  • User login status:
    • User is logged in
    • User is not logged in
    • User has failed payment status
    • It is the user’s first login
  • User role status:
    • User has any or all of the roles selected
    • User does not have any or all of the roles selected
  • PHP statement:
    • Any WordPress conditional statement
    • Any WooCommerce conditional statement
    • Predefined conditional
  • GamiPress User status:
    • User has any or all of the achievements selected
    • User does not have any or all of the achievements selected
    • User has any or all of the ranks selected
    • User does not have any or all of the ranks selected
    • User has a points type total that compares with a value
  • Learndash User status:
    • User is enrolled in any or all of the courses selected
    • User is not enrolled in any or all of the courses selected
    • User has not started any or all of the courses selected
    • User has in progress any or all of the courses selected
    • User has completed any or all of the courses selected
    • User has not completed any or all of the lessons selected
    • User has completed any or all of the lessons selected
    • User has not completed any or all of the topics selected
    • User has completed any or all of the topics selected
  • WooCommerce User status:
    • User has purchased any or all of the products selected
    • User has not purchased any or all of the products selected
    • User has pending status for any or all of the subscriptions selected
    • User has active status for any or all of the subscriptions selected
    • User has on hold status for any or all of the subscriptions selected
    • User has pending cancellation status for any or all of the subscriptions selected
    • User has cancelled status for any or all of the subscriptions selected
    • User has expired status for any or all of the subscriptions selected
  • …any multiples and combinations of the above.

Activation

Steps to enable Widget Control module

  1. In the WordPress administrator main navigation click ActiveMember360, Modules.
  2. In ActiveMember360 Modules tabs click Widget Control.
  3. Set Enable Widget Control module to Yes/On.
  4. Click Save Settings.

Configuration & Settings

Widget visibility can be controlled using two distinct methods with ActiveMember360.

The most advanced way is using Conditional mode. However an Individual mode is also supported.

Recommendation

We would always recommend using Conditional mode as it provides the greatest flexibility regarding the conditions available to control the display of the widget for personalization and segmentation.

Adding/defining a Conditional is detailed at Adding Conditionals.

Individual mode is primarily available to provide backward compatibility for widget visibility controls defined prior to Conditionals being introduced.

Conditional Mode

Steps to specify widget visibility using conditional mode

  1. In the WordPress administrator main navigation click Appearance, Widgets.

  2. Select the required widget.

  3. Locate the ActiveMember360 Widget Conditions panel.

  4. Select Conditional from the Control mode drop down.

  5. From the Display if the conditional evaluates drop down select whether the conditional needs to evaluate as True or False to display the widget.

  6. From the Conditional drop down select the required conditional to be evaluated.

    Active conditionals are shown in the drop down with the suffix of (publish).

  7. Once the settings have been completed ensure Save is clicked to save the configuration.

Individual Mode

Steps to specify widget visibility using individual mode

  1. In the WordPress administrator main navigation click Appearance, Widgets.

  2. Select the required widget.

  3. Locate the ActiveMember360 Widget Conditions panel.

  4. Select Individual from the Control mode drop down.

  5. Set the widget Display when setting to Always, Is Logged In, Not Logged In and Never.

    The default Display when setting is to Always display the selected widget.

    Beware

    The Display when setting works in conjunction with the other ActiveMember360 visibility conditions of Display if the visitor has tags, Do not display if the visitor has tags and the PHP condition to determine the widget visibility.

    They work as AND conditions. If any conditions evaluate as FALSE the widget will not be visible.

    If Never is selected as the Display when setting irrespective of other conditions the widget will never be shown. The purpose of this Never setting is to keep the widget settings in place should you wish to effectively disable the widget.

  6. Set visibility conditions for the WordPress widget based upon the ActiveCampaign contact tag/tags the visitor has.

    From the AND if the visitor has ANY of the following tags: drop down select the ActiveCampaign tag(s) the user should have for this condition to evaluate as TRUE. The user can have ANY of the tags specified for the condition to evaluate as TRUE.

    Click in the selection area and start typing part of the tag name to refine the list.

    Then click on the required tag.

    Multiple tags can be selected.

    Individual tags can be removed from the selection by clicking on the x shown next to the individual tag name.

    Beware

    For not logged in users this condition will always evaluate as FALSE if tags are specified.

  7. Set visibility conditions for the WordPress widget based upon the ActiveCampaign contact tag/tags the visitor does not have.

    From the AND if the visitor has NONE of the following tags: drop down select the ActiveCampaign CRM tag(s) the user should not have for this condition to evaluate as TRUE. The user must have NONE of the tags specified for the condition to evaluate as TRUE. If the contact has any of the selected tags the widget will not be displayed.

    Click in the selection area and start typing part of the tag name to refine the list.

    Then click on the required tag.

    Multiple tags can be selected.

    Individual tags can be removed from the selection by clicking on the x shown next to the individual tag name.

    Beware

    For not logged in users this condition will always evaluate as TRUE.

  8. Set visibility conditions for the WordPress widget based upon a conditional PHP statement.

    In the AND the following PHP condition is true: input area define the PHP conditional statement.

    Any valid PHP conditional function can be used.

    ActiveMember360 has conditional functions that can be used:

    mbr_has_tags()

    Here are some examples:

    a. Statement evaluates as TRUE if the user HAS tag 123.

    mbr_has_tags( '123' )

    b. Statement evaluates as TRUE if the user HAS tag 123 OR 234.

    mbr_has_tags( '123,234' )

    c. Statement evaluates as TRUE if the user HAS tag 123 OR 234.

    mbr_has_tags( array(123,234) )

    d. Statement evaluates as TRUE if the user HAS tag 123 AND 234.

    mbr_has_tags( '123,234', 'all' )

    e. Statement evaluates as TRUE if the user HAS tag 123 AND 234.

    mbr_has_tags( array(123,234), 'all' )
    Note

    Any function preceded with an exclamation mark ! specifies the negative use case of the function.

    f. Statement evaluates as TRUE if the user DOES NOT HAVE tag 123.

    !mbr_has_tags( '123' )
    Note

    It is also possible to combine conditions with && (representing AND) and || (representing OR).

    g. Statement evaluates as TRUE if the user HAS tag 123 AND DOES NOT HAVE tag 234.

    mbr_has_tags( '123' ) && !mbr_has_tags( '234' )

    h. Statement evaluates as TRUE if the user HAS tag 123 OR DOES NOT HAVE tag 234.

    mbr_has_tags( '123' ) || !mbr_has_tags( '234' )
    Note

    You can also use any conditional tags including WordPress and WooCommerce conditional tags.

    A list of WordPress Conditional Tags can be found here:

    WordPress Conditional Tags

    A list of WooCommerce Conditional Tags can be found here:

    WooCommerce Conditional Tags

    i. Statement evaluates as TRUE if this is the home page.

    is_home()
  9. Once the settings have been completed ensure Save is clicked to save the configuration.