Ever installed Magento using a one click installer and forgot to remove the “wp_” prefix ?
Simple to remove your tables ? Nope ! pesky Foreign Key Constraints !
Try this code in your favourite MySql program. Please note running the resulting SQL code this will immediately delete all of your databases prefixed with “wp_” so if you are not sure back up ! Read More
This simple snippet of PHP code will apply the ‘current-cat’ class to any categories in the WordPress categories widget that the current post resides in.
Add this code to your single.php template file in your current template. Make sure you have a .current-cat class in your css.
$post_categories = wp_get_post_categories( $post->ID );
$script_out = '';
foreach($post_categories as $c):
$cat = get_category( $c );
$script_out .= "$('.cat-item-".$cat->cat_ID."').addClass('current-cat');";
This assumes jQuery is included and uses $ to declare it.
Wordpress spam sign ups are a real pain. If you need to do some work on the database to do a mass clean-up of spam users. I created this little MySql query which basically counts the number of full-stops or dots in an email address. Having recently done this for a client, I noticed a pattern especially in @gmail accounts where the same word is used as an email address but has full stops positioned in different places in the email address. To the human eye this sticks out like a sore thumb. So in order to check via a query I created this query. Read More
This is a tricky one and should be a lot easier than it seems to be.
First you need to add a snippet of code to your functions.php file in your active theme. To disable the contact form 7 style and stop it being appended to your page and overriding your style. Read More
We all know how good Wordpress is as blog and decent level CMS system. One of the annoying traits of the gallery script in WordPress is that it embeds a <style> tag in your page overriding all your CSS styles for the gallery. Making it difficult to style the WordPress gallery.
As a Magento Developer some of the things I always forget and have to look up.
Here is a handy list you can copy and paste with all countries and thier two letter iso 3661 codes, used by most payment processors as the company identification codes. Ideal for building drop down lists or tables. Read More