Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Evan Herman

    (@eherman24)

    Hey Tim,

    Do you want the subscriber count displayed on the front end of the site? Or are you trying to view the number of subscribers currently subscribed to a given list from the dashboard?

    Right now, you can view all of your current subscribers and the total count from the ‘Manage List Forms’ page. Next to the Subscriber count is a small view button. Clicking that will bring up a modal with all of your subscribers listed nicely in a table. You can filter and search through if you have hundreds of subscribers.

    Reference

    Thanks,
    Evan

    Thread Starter timbim

    (@timbim)

    Hey Evan,

    thanks for this information. I want the subscriber count displayed on the front end of the site. Is that possible?

    Cheers,
    Tim

    Plugin Author Evan Herman

    (@eherman24)

    Hey Tim,

    It should be possible as the function is baked into the plugin. It would be a matter of using the function within your template file.

    Let me do a few tests and I’ll get back to you here with some of my findings, shortly. As a sidenote, I’ve added that to our list of functionality to add into the next release ( v5.1 ) – https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues/115

    Thanks,
    Evan

    Plugin Author Evan Herman

    (@eherman24)

    Hey Tim,

    After a bit of testing I’ve come up with a function that you can include in your functions.php file that will either hook before or after the form and display the current subscriber count. Obviously, you can change the text but the subscriber count variable must remain as is.

    This function will work if you only have 1 form on your site. If you have imported multiple forms onto your site, the first function won’t work…You’ll need to handcode the form ID into the function. ( If that’s the case, skip down to the second function below )

    Single Form Imported To Site

    /**
    *	Display the subscriber count before all forms
    **/
    function display_mc_subscriber_count() {
    	$mailChimp = new yksemeBase();
    	$list = $mailChimp->getListsData();
    	$list_id = key($list);
    	echo '<h4>Join <strong>' . $list['subscriber-count']['subscriber-count-'.$list_id] . '</strong> others, and sign up for our mailing list!</h4>';
    }
    add_action( 'yks_mc_before_all_forms' , 'display_mc_subscriber_count' );

    You can drop that function directly into your child themes function.php file. As you can see the action hook used is yks_mc_before_all_forms, which will display the subscriber count before ALL forms on your site.

    If you want to display it on a specific form, you can use the following action hook with your form ID in place of the $form_id variable:

    add_action( 'yks_mc_before_form_'.$form_id , 'display_mc_subscriber_count' )

    You can also do the same after your forms using the yks_mc_after_all_forms and yks_mc_after_form_$form_id hooks.

     
     

    Multiple Forms Imported To Site

    /**
    *	Display the subscriber count before all forms
    **/
    function display_mc_subscriber_count() {
    	$mailChimp = new yksemeBase();
    	$list = $mailChimp->getListsData();
    	echo '<h4>Join <strong>' . $list['subscriber-count']['subscriber-count-eff28bd985'] . '</strong> others, and sign up for our mailing list!</h4>';
    }
    add_action( 'yks_mc_before_all_forms' , 'display_mc_subscriber_count' );

    ** Note ** the form ID was hardcoded into $list['subscriber-count']['subscriber-count-eff28bd985']. Drop your form ID into the function to display the subscriber count for that given list.

    I hope that helps explain a bit and gets you pointed in the right direction! Let us know!

    Thanks,
    Evan

    Thread Starter timbim

    (@timbim)

    Hi Evan,
    thanks for that!
    Tim

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Subscriber counter display?’ is closed to new replies.