Hi flatrock,
The SubMe plugin doesn’t show the number of followers. It is also not possible to show this with just CSS. One way to show the number of followers is to change to SubMe plugin code. But then you would have to change the code every time the plugin gets updated. It is best to create a separate plugin that show the number of SubMe followers. To get you started I created an extra plugin you could use.
1. Create a file with the filename ‘subme_status.php’ in your /wp-content/plugins’ direcory and copy/paste the following code into it.
<?php
/*
* Plugin Name: SubMe Status
* Description: Displays the number of SubMe followers
* Version: 1.0
* Author: SubMe
* Licence: GPL3
*/
class subme_status {
public function init() {
add_action( 'widgets_init', array( &$this, 'add_widget' ) );
}
function add_widget() {
register_widget( 'subme_status_widget' );
}
}
/* Subme Widget Class */
class subme_status_widget extends WP_Widget {
public function __construct() {
parent::__construct(
'subme_status_widget',
'Subme Status',
array ('description' => 'Displays the number of SubMe followers', )
);
}
public function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
$title = $instance['title'];
?>
<p><label for="<?php echo esc_attr( $this->get_field_id('title') ); ?>">Title: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name('title') ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></label></p>
<?php
}
/* Creating widget front-end */
public function widget( $args, $instance ) {
global $wpdb;
extract( $args );
$table = $wpdb->prefix . 'subme';
$query = "SELECT COUNT(*) AS <code>followers</code> FROM $table WHERE <code>active</code>=1";
if ( ! ( $result = $wpdb->get_results( $query ) ) ) {
$followers = 0;
} else {
$followers = $result[0]->followers;
}
$title = apply_filters( 'widget_title', $instance['title'] );
/* Before and after widget arguments are defined by themes */
echo $args['before_widget'];
echo '<div class="widget-text wp_widget_plugin_box">';
if ( $title ) {
echo $before_title . $title . $after_title;
}
if ( 1 == $followers ) {
echo "There is 1 follower";
} else {
printf( "There are %d followers", $followers );
}
echo '</div>';
echo $args['after_widget'];
}
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['text'] = strip_tags( $new_instance['text'] );
$instance['textarea'] = strip_tags( $new_instance['textarea'] );
return $instance;
}
}
global $my_subme_status;
$my_subme_status = new subme_status;
$my_subme_status->init();
?>
2. A plugin called ‘SubMe Status’ should now be visible in the Plugins admin panel of your WordPress site. Activate it.
3. Go to Appearance -> Widgets and move the ‘SubMe Status’ to wherever you want it to show.
If you follow the above steps correctly, then you should now see the number of active followers you have on your website.
Enjoy!