WordPress.org

Forums

Subscribe2
Subscribe2 count on page rather than using widget (1 post)

  1. rwblackburn
    Member
    Posted 3 years ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Subscribe2
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by rwblackburn
  • This topic is not a support question
  • WordPress version: 3.3.2