Support » Plugin: Subscribe2 - Form, Email Subscribers & Newsletters » Subscribe2 count on page rather than using widget

  • I wanted the count of subscribers just on one page rather than via a widget on the sidebar. This may be something others would find of interest and worth adding to a future version. I did it by adding the following code to functions.php which created a shortcode called [wbsub2count]. I only wanted the number confirmed but in case someone wanted the number registered or the total I’ve left in the line to get the number registered as well.

    function wbsub2countshow()
    {
        global $mysubscribe2;
        $registered = $mysubscribe2->get_registered();
        $confirmed = $mysubscribe2->get_public();
        $count = count($confirmed);
    
        $mystring="We currently have " . $count . " subscribers";
        return $mystring;
    }
    
    add_shortcode('wbsub2count','wbsub2countshow');

    http://wordpress.org/extend/plugins/subscribe2/

  • The topic ‘Subscribe2 count on page rather than using widget’ is closed to new replies.