WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] Manually adding the Subscribe2 counter widget? (4 posts)

  1. jord79
    Member
    Posted 2 years ago #

    Hi,

    Can anyone tell me how to manually add the Subscribe2 counter widget?

    I want it to say "Join 133 other followers" for example and the number changes with the amount of subscribers we have.

    Unfortunately I can't add the counter through the widgets tab, as we have customised a few things on the page.

    Look forward to your help.

    Jordan

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

  2. mattyrob
    Member
    Plugin Author

    Posted 2 years ago #

    @jord79,

    You'll have to pull some of the code out of the Counter Widget and put that into your sidebar. The code for the widget is at:
    wp-content/plugins/subscribe2/include/counterwidget.php

  3. jord79
    Member
    Posted 2 years ago #

    Thanks for the help!

    Will give it a go.

  4. tnmore
    Member
    Posted 1 year ago #

    /**
    	Displays the Widget
    	*/
    	function widget() {
    
    		$title = 'email subscribers';
    		$s2w_bg = '#e3dacf';
    		$s2w_fg = '#345797';
    		$s2w_width = '82';
    		$s2w_height = '16';
    		$s2w_font = '11';
    
    		global $mysubscribe2;
    		$registered = $mysubscribe2->get_registered();
    		$confirmed = $mysubscribe2->get_public();
    		$count = (count($registered) + count($confirmed));
    		echo "<div cass=\"esub\">";
    		echo "<span = \"esubtitle\">" . $title . "</span>" .":". "<span class=\"count\">" . $count . "</span>";
    		echo "</div>";
    		echo $after_widget;
    	}
    	widget();
    	?>

    this is the code i use, just for future reference to others as i stumbled upon this page looking for an answer.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags