Wordpess 3.4+, Using Theme Customizer

WordPress 3.4 introduced the Theme Customizer API. An excellent way to include customization options into a theme build. These features are not well documented on the WordPress.org Codex site, but there are several pages online that dig a bit deeper into the options and inner working of the Theme Customizer API. External References: https://codex.wordpress.org/Theme_Customization_API http://wp.tutsplus.com/tutorials/theme-development/digging-into-the-theme-customizer-components/… Continue reading Wordpess 3.4+, Using Theme Customizer

Verify Your RichSnippets / Schema.org / OpenGraph / Microformats

Another useful tool from Google: http://www.google.com/webmasters/tools/richsnippets A very useful tool for when you’re trying to verify your: Rich Snippets (Google’s name for all types of descriptive meta info.) Schema.org (Google’s backing this one) OpenGraph (Facebook implemented this one) Microformats (The old, but still supported, version)

WordPress Find All Global Details

The following piece of code will help list all objects, arrays and vars in the $GLOBALS variable scope. < ?php foreach($GLOBALS as $glob_key => $glob_val){ echo $glob_key.” – “; echo (is_array($glob_val)||is_object($glob_val))?print_r($glob_val,1):$glob_val; echo “\r\n”; } ?> This can be very useful as there is usually a lot of information stored in $GLOBALS by both WordPress and… Continue reading WordPress Find All Global Details

In WordPress, Replace Text In All Fields

Replacing, Updating, Changing text in WordPress fields is as easy as using the MySQL replace command. Here’s an example for updating the post_title field: update wp_posts set post_title = REPLACE(post_title, ‘Old’, ‘New’) WHERE post_title LIKE ‘%Old%’; This will update all the columns that have the word ‘Old’ in their post_title field with the word ‘New’.… Continue reading In WordPress, Replace Text In All Fields

Spam all pending WordPress comments SQL statment

SQL code to change all pending comments to spam: UPDATE `wp_comments` SET `comment_approved`=’spam’ WHERE `comment_approved` = 0; If you’re not using Akismet, and you’ve let your pending, most likely “spam” comments, pile-up; the above SQL code will help convert all pending comments to spam. So comments like: What an insightful idea has been written here.… Continue reading Spam all pending WordPress comments SQL statment

MySQL remove duplicates

DELETE n1 FROM table n1, table n2 WHERE n1.id > 10000 AND n1.id < 11000 AND n1.id > n2.id AND n1.EMAIL = n2.EMAIL; The above MySQL query will delete duplicate email addresses between the id’s 10000 and 11000. Breaking the query into blocks of 1000 id’s will reduce strain the MySQL server.

MySQL find duplicates

select EMAIL, count(EMAIL) as cnt from TABLE group by EMAIL having cnt > 1 ORDER BY `cnt` DESC The above MySQL query will find and list the number of multiple duplicate emails in a table.

PHP imagick – website references, manuals and information

http://eclecticdjs.com/mike/tutorials/php/imagemagick/ http://jamesroberts.name/blog/tag/imagick/ Mikko’s blog imagick is a more advanced graphics library than the default GD for PHP, but the ImageMagick PHP library imagick is only documented on PHP.net comments, so using the library can be a bit challenging, but the sites above help in using the library.