View Sidebar

Welcome to my website!

I am a WordPress developer, Specialist in orthodontic and healthcare information systems, consultant, .NET & PHP dev, husband, father, assistant scoutmaster.
From MS SQL to MySQL

From MS SQL to MySQL

logo-mysql-110x57Tonight as I was working on a pet project (an automated appointment reminder system), I decided to port my MS SQL database to MySQL. I have worked with MySQL in .Net before, but a while back. I use MySQL all the time for WordPress. I was thinking of licensing costs for MSSQL since this is a pet project and I currently have no income with it. I was very pleased with the results of using the MySQL Connector for .Net in my project. I think that’s the route I’ll stick with.

Peace and long life

August 9, 2014Comments are DisabledRead More
MP6 Dashboard Plugin Included in Core of 3.8

MP6 Dashboard Plugin Included in Core of 3.8

I was introduced to the MP6 plugin (by Automattic) several weeks ago and started using it with new WordPress sites I was developing. I love the cleaner look. I was glad when it was announced that the MP6 dashboard would be included in the 3.8 core. I am now running 3.8 RC2 on this site. I have not noticed any issues thus far.

Here’s the dashboard without MP6:

Here’s the dashboard in 3.8 RC2:

Peace and long life

December 10, 20130 commentsRead More
Display WooCommerce Cart Item Count on Favicon

Display WooCommerce Cart Item Count on Favicon

Just sharing my solution to displaying the number of items in the WooCommerce shopping cart on the favicon in the user’s browser. I placed the code below in my footer.php file just above the closing </body> tag. See details below the code sample.

<?php global $woocommerce; ?>
<?php
$my_cart_count = $woocommerce->cart->cart_contents_count;
if ($my_cart_count > 0) :
?>
 <script src="<?php bloginfo('stylesheet_directory'); ?>/js/favico-0.3.3.min.js" type="text/javascript"></script>
 <script type="text/javascript">
 var favicon=new Favico({
 animation:'pop'
 });
 favicon.badge(<?php echo $my_cart_count; ?>);
 </script>
<?php
endif;
?>

screenshot_cart_favicon

The script that makes this possible is the favico.js script found at http://lab.ejci.net/favico.js/. They have the code to download and examples of customizing the icon display. One drawback with the favico.js script to date is that it only supports a number up to 9 and not larger*. This may be changed in a future revision.

Obviously this script assumes you are using the WooCommerce plugin for your ecommerce solution. To use this with another ecommerce solutions, you could change this code by replacing the method of obtaining $my_cart_count value based on your ecomm tool of choice.

*UPDATE: Dec 1 2013 – as of version 0.3.3, the script now supports two digits so the number can be larger than 9 now.

September 24, 20130 commentsRead More
Change ‘Enter Title Here’ text for CPT

Change ‘Enter Title Here’ text for CPT

Needed this recently. Nice simple fix to change the post title text “Enter Title Here” to your custom post type.

http://wp-snippets.com/change-enter-title-here-text-for-custom-post-type/

November 15, 20120 commentsRead More
Sorting WPAlchemy Metabox Grouped Fields

Sorting WPAlchemy Metabox Grouped Fields

I needed to change the sort order of my grouped fields. On a theme I was developing, there was a custom post type for Albums. Each album needed multiple attached song samples to load in a jPlayer playlist. I used WPAlchemy to include metaboxes for the administrator to upload his own song samples. But he wanted to be able to re-order/sort the songs after he uploaded them.

This was the solution I found on the class author’s website. It enables an easy, “drag to sort” function for sorting the meta box fields.

http://www.farinspace.com/sorting-wordpress-meta-box-fields/

The above page has two videos showing how to code the sort solution. For your use, I’ve included the text of the code below:

<p id="sort_warning" style="display:none; color:red;">
	Remember to click Save Changes or Update to save your sort order!
</p>

<style>
	#wpa_loop-links .wpa_group
	{ border: 1px solid #ccc;
	padding:10px; margin: 0 10px 15px; background-color:#fff; }
</style>

<script type="text/javascript">
	//<![CDATA[
	jQuery(function($)
	{
		$('#wpa_loop-links').sortable(
		{
			change: function()
			{
				$('#sort_warning').show();
			}
		});
	});
	//]]>
</script>

Many thanks to Dimas for providing this class and this sort solution.

Peace and long life

September 6, 20120 commentsRead More