- thinelectrons.com - http://thinelectrons.com/blog -
WP-Stats Widget Plugin
Posted By Patricia Ritsema van Eck On 9th September 2006 @ 12:34 In Thin Electrons | No Comments
[1] Use with my WP Blog Installation Action Sheets!
CONCERNS:
REQUIRES:
1st PROBLEM:
[2] WP-Stats has a new feature which allows you to show your blog statistics in the sidebar. Very cool so I wanted this too. However, the feature is a [3] widget and this is supposed to be activated from within admin/presentation/sidebar widgets where you can ‘drag’ the stats widget into the sideabar - which of course didn’t show up by default in my blog…
1st SOLUTION:
Install the [4] widget plugin as well. After activation I found the sidebar widgets page under the admin/presentation tab.
2nd PROBLEM:
The [4] widget plugin needs your theme to be compatible with widgets because it features a dynamic sidebar. This means you need to install an extra file into your theme folder called functions.php and add the php code for displaying a dynamic sidebar in your sidebar.php (which requires your theme’s sidebar to be formatted as a bulleted list (ul/li/h2 standard).
2nd SOLUTION:
Luckily I chose to use (and customize) Patricia Müller’s [6] Connection theme for this blog and another Connection’s fan ([7] Ajay D’Souza) tweaked her script to be compatible with widgets. He’s called it [8] Connections Reloaded and it has some additional improvements on the original theme as well. His theme download includes all the necessary coding and the functions.php file.
Because Ajay made quite a few changes to the original script, it’s best to upload the whole theme folder instead of only uploading the sidebar.php file and functions.php file to the Connections folder. Then of course customize this script again to resemble the current settings. All in all this kept me of the street for a day or two…
The dynamic sidebar code:
<?php if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar() ) { ?>
<?php } ?>
The sidebar.php had the dynamic sidebar code wrapped around the complete sidebar, meaning that activating the dynamic sidebar seems to wipe out everything else you already have in there. Since at this point I only wanted the stats widget to display in between my other sidebar items, I rearranged the code and placed it in between 2 other items (even with conditional tags around so the stats only show on the home page and any archives page, but not on single pages and page pages).
<?php if(is_archive()) { ?>
<?php if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar() ) { ?>
<?php } ?>
<?php } ?>
<?php if(is_home()) { ?>
<?php if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar() ) { ?>
<?php } ?>
<?php } ?>
RESOURCES:
[9] http://dev.wp-plugins.org/wiki/wp-stats
[10] http://forums.lesterchan.net/viewtopic.php?t=732
[11] http://automattic.com/code/widgets
[12] http://automattic.com/code/widgets/themes/
[13] http://widgets.wordpress.com/
[14] http://ajaydsouza.com/wordpress/wpthemes/connections-reloaded/
COMMENTS:
You can find a list of all currently upgraded blog themes at the [15] WordPress Widgets blog. The widgets site has more [16] instructions on adjusting your theme in case the theme developer hasn’t upgraded his or hers yet.
Article printed from thinelectrons.com: http://thinelectrons.com/blog
URL to article: http://thinelectrons.com/blog/wp-blog-installation-action-sheets/wp-stats-widget-plugin/
URLs in this post:
[1] Use with my WP Blog Installation Action Sheets!: http://thinelectrons.com/blog/wp-blog-installation-action-sheets/
[2] WP-Stats: http://dev.wp-plugins.org/wiki/wp-stats
[3] widget : http://widgets.wordpress.com/
[4] widget plugin: http://automattic.com/code/widgets
[5] widget plugin: http://automattic.com/code/widgets
[6] Connection theme: http://vanillamist.com/blog/?page_id=64
[7] Ajay D’Souza: http://ajaydsouza.com/
[8] Connections Reloaded: http://ajaydsouza.com/wordpress/wpthemes/connections-reloaded/
[9] http://dev.wp-plugins.org/wiki/wp-stats: http://dev.wp-plugins.org/wiki/wp-stats
[10] http://forums.lesterchan.net/viewtopic.php?t=732: http://forums.lesterchan.net/viewtopic.php?t=732
[11] http://automattic.com/code/widgets: http://automattic.com/code/widgets
[12] http://automattic.com/code/widgets/themes/: http://automattic.com/code/widgets/themes/
[13] http://widgets.wordpress.com/: http://widgets.wordpress.com/
[14] http://ajaydsouza.com/wordpress/wpthemes/connections-reloaded/: http://ajaydsouza.com/wordpress/wpthemes/connections-reloaded/
[15] WordPress Widgets: http://widgets.wordpress.com/
[16] instructions on adjusting your theme: http://automattic.com/code/widgets/themes/
[17] : http://del.icio.us/post?url=http://thinelectrons.com/blog/wp-blog-installation-a
ction-sheets/wp-stats-widget-plugin/&title=WP-Stats Widget Plugin
[18] : http://furl.net/storeIt.jsp?t=WP-Stats Widget Plugin&u=http://thinelectrons.
com/blog/wp-blog-installation-action-sheets/wp-stats-widget-plugin/
[19] : http://user.my-tuts.com/tag-tutorial/?url=http://thinelectrons.com/blog/wp-blog-
installation-action-sheets/wp-stats-widget-plugin/&title=WP-Stats Widget Plugin
[20] : http://feedmelinks.com/categorize?from=toolbar&op=submit&name=WP-Stats Widget Pl
ugin&url=http://thinelectrons.com/blog/wp-blog-installation-action-sheets/wp-stats-widget-plugin/&version=0.7
Click here to print.