• Resolved abzu2

    (@abzu2)


    Had to deactivate all my plugins to isolate a problem. After reactivating Simple Blog Stats, no posts count is displayed on the shortcode on the sidebar widget. The syntax was not changed after reactivation and remains as:

    <span class=”sbs-count-posts”>[sbs_posts]</span>

    Only the text: [sbs_posts] is visible but no posts count. ??

    Have activated and reactivated without any change to the problem.

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help, which version of the plugin are you using?

    Thread Starter abzu2

    (@abzu2)

    Thank you for your quick reply. Simple Blog Stats Version 20171103
    Any known conflicts with your plugin and:
    > Stats Counter
    > Slimstat Analytics
    > Post Views Counter
    > Official StatCounter Plugin

    Plugin Author Jeff Starr

    (@specialk)

    That is the latest version. So yes if you are running other plugins, you can do some basic troubleshooting to see if there any conflicts. There should be none, no issues have been reported so far with any of those plugins.

    Also maybe useful, there are three locations where you can test/check your post stats:

    – Using the shortcode, [sbs_posts]
    – Via the SBS Dashboard Widget
    – Via the plugin settings page

    So your post count should be the same (and correct) in all of those places.

    Thread Starter abzu2

    (@abzu2)

    As a test, I deactivated the plugins that I thought might have some conflict with SBS:
    > Stats Counter
    > Slimstat Analytics
    > Post Views Counter
    > Official StatCounter Plugin
    Problem persisted.
    Viewing the information on the SBS settings, everything appeared to be correct.
    Using the shortcode: <span class=”sbs-count-posts”>[sbs_posts]</span>
    and entering the shortcode both in a text and a Custom HTML widget it fails to solve the [sbs_posts] text only issue.
    Fail to see any SBS Dashboard Widget either in the available widgets in Dashboard> Appearance> Widgets or in Dashboard.

    Question: If I reset SBS to default, I assume it will delete my current data, however, will it appear again afterwards ??

    • This reply was modified 7 years, 4 months ago by abzu2.
    Thread Starter abzu2

    (@abzu2)

    Tried restoring to default/saved settings/ deactivated/ activated. Problem persists. ??

    Thread Starter abzu2

    (@abzu2)

    Weird. I have uninstalled SBS and re-installed it. Logged out of my site after uninstalling and reinstalled after logging back in. Just in case. Problem still persists.
    I have used SBS for some time without any problem on a Child theme of Elucidate. Therefore doubt that it could be a theme related issue. ??

    • This reply was modified 7 years, 4 months ago by abzu2.
    Plugin Author Jeff Starr

    (@specialk)

    Think I figured this out. By default, WordPress does not execute shortcodes in widget areas. You can easily enable shortcodes in widgets by adding one line to your current theme’s functions.php file:

    add_filter('widget_text', 'do_shortcode', 10);

    Just paste anywhere (like at the bottom of the file) in functions.php and you should be good to go.

    Thread Starter abzu2

    (@abzu2)

    Thank you for your kind suggestion. Being a HTML ignoramus I would appreciate if you could tell me EXACTLY where I should insert the suggested line in my functions.php file.

    At the top I have:

    <?php 
    
    function elucidate_byline() {
    	printf( __( 'Posted by', 'elucidate' ) . ' ' . '<span class="author vcard"><a href="%1$s">%2$s</a></span>',
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_html( get_the_author() )
    	);
    }
    
    if ( ! function_exists( 'elucidate_setup' ) ) :
    /**
     * Sets up theme defaults and registers support for various WordPress features.
     *
     * Note that this function is hooked into the after_setup_theme hook, which runs
     * before the init hook. The init hook is too late for some features, such as indicating
     * support post thumbnails.
     */
    function elucidate_setup() {
    
    	/**

    At the bottom:

    /**
    	 * Enable support for Post Formats
    	 */
    	add_theme_support( 'post-formats', array( 'aside', 'image', 'quote' ) );
    
    	/**
    	 * Setup the WordPress core custom background feature.
    	 */
    	add_theme_support( 'custom-background', apply_filters( 'elucidate_custom_background_args', array(
    		'default-color' => 'ffffff',
    		'default-image' => '',
    	) ) );
    }
    endif; // elucidate_setup
    add_action( 'after_setup_theme', 'elucidate_setup' );
    
    Plugin Author Jeff Starr

    (@specialk)

    Like I said before, just paste the line at the bottom of the file. So you can:

    1. Open the file
    2. Scroll all the way down to the end of the file
    3. Add a couple of new lines
    4. Paste the code on the last new line

    Plugin Author Jeff Starr

    (@specialk)

    So in your specific functions.php file, you should have this as the last three lines:

    add_action( 'after_setup_theme', 'elucidate_setup' );
    
    add_filter('widget_text', 'do_shortcode', 10);
    Plugin Author Jeff Starr

    (@specialk)

    You could even add a comment, so you know why you added it, for example the last four lines would look like this:

    add_action( 'after_setup_theme', 'elucidate_setup' );
    
    // enable shortcodes in widgets
    add_filter('widget_text', 'do_shortcode', 10);
    Thread Starter abzu2

    (@abzu2)

    Thank you for your kind reply. The suggested addition to the functions.php file solved the issue.

    Plugin Author Jeff Starr

    (@specialk)

    Awesome, glad it worked.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘only shortcode text displayed on sidebar widget’ is closed to new replies.