Category Archives: Tech Tips

14 Most Popular Woo Themes

Backstage A powerful niche theme design for musicians and artists showcasing their media, upcoming shows and music using hugely flexible custom widgets and audio players. This beautifully crafted layout was designed by Elliot Jay Stocks and boasts 7 alternate styles. Live demo – Read more Biznizz Built on WooThemes own winning formula, Biznizz will give your website a fresh new look. Its integrated slider and custom homepage layout, in addition to the optional portfolio page template, makes Biznizz a great candidate for your next business website. Live demo – Read more Caffeinated This personal portfolio theme by Ryan Downie was originally designed for his own personal use – fueled by his passion for Coffee, Red Bull and lunchtime pot of noodles according to his Twitter stream. It’s perfect for anyone wanting a bold design to show off their work. Live demo – Read more City Guide This theme was developed to cater for directory-based WordPress sites. For example, a guide to a city with shops, restaurants and other places of interest all archived in posts with geo-tags, custom content about the locations, and well presented in this killer theme designed by Sam Brown. Live demo – Read more Continuum A Magazine theme which features a custom homepage, custom typography and some extra custom widgets, all to help your news/magazine website get a stylish and functional look. Designed by Simon Collison. Live demo – Read more Crisp Designed by Tyler Galpin, and boasting all-new tumblog functionality with a quick publishing form on the dashboard Crisp is perfect for lazy bloggers who … Continue reading

Posted in Design, Tech Tips, Web Development | Tagged , , , , | 1 Comment

MySql UPDATE JOIN Example

MySql UPDATE LEFT / CENTER / RIGHT JOIN Example This is the correct way to update a table when using a JOIN. They key is that the SET needs to come after the JOIN. UPDATE wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) SET wp_term_taxonomy.taxonomy = ‘category’ WHERE 1 AND wp_term_taxonomy.taxonomy = ‘category’ AND wp_term_taxonomy.term_id IN (1) This WILL NOT WORK because the SET is in the wrong place: UPDATE wp_posts SET wp_term_taxonomy.taxonomy = ‘category’ LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE 1 AND wp_term_taxonomy.taxonomy = ‘category’ AND wp_term_taxonomy.term_id IN (1)

Posted in Tech Tips, Web Development | Tagged , , , , | Leave a comment

WordPress: SQL to get all Categories

If you’re trying to get all categories in WordPress with a real, raw, mysql sql statement, this is the type of query you can use: SELECT * FROM wp_term_relationships LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE wp_term_taxonomy.taxonomy = ‘category’ GROUP BY wp_term_taxonomy.term_id This is how you can get posts of a certain category / taxonomy. I have a few extra lines commented out that could also be used: SELECT * FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE 1 #AND wp_term_taxonomy.taxonomy = ‘category’ AND wp_term_taxonomy.term_id IN (13) #AND wp_term_taxonomy.term_id IN (1,2,3,4,5,6,7) GROUP BY wp_posts.ID ORDER BY ID

Posted in Social Media, Tech Tips, Web Development | Tagged , , , , , | Leave a comment

Applescript: Check Application Is Running

Below is my Applescript example of how to check if an application is running, such as Finder.app, VLC.app, itunes.app, or something along those lines. Quite often I need to check if an application is running as part of my applescript, and so I use this little function / subroutine in applescript to test if the application is running: on appIsRunning(appName) tell application “System Events” to (name of processes) contains appName end appIsRunning Example usage: display dialog appIsRunning(“Finder”) The above apple script example will show “true” in a popup dialog.

Posted in Mac, Software, Tech Tips | Tagged , , , , , , , , | Leave a comment

OS X Lion: Printing Multiple Pages per Sheet

I’ve been disappointed that the preview in the OS X Lion does not show multiple pages per sheet like Leopard and Snow Leopard did. I often do this to conserve paper when I’m printing lecture notes. With Leopard, I’m often doing this blind and get things out of order. Preview or Acrobat provide this functionality, but in Preview the functionality is hidden under the “Preview / Layout” dropdown option: To print multiple pages per sheet, first select the Layout option from the Print dialog. It is part of the menu marked “Preview.” Then, choose the number of pages which should be printed on one side of a single sheet of paper. With this example, there will be two pages on each side, for a total of four pages on a single sheet of paper when duplexed. You can also optionally set the layout direction, and whether a border should be printed around each individual page.

Posted in Mac, Software, Tech Tips | Tagged , , , , , , | Leave a comment

WordPress: Mutiple Youtube Embeds

You need to use shortcodes to have multiple WordPress embeds in a single post. See the examples below: This won’t work: Part 1 http:///www.youtube.com/watch?v=n7KQ4vkiNUk Part 2 http:///www.youtube.com/watch?v=3qmtwa1yZRM Part 3 http:///www.youtube.com/watch?v=-hidvElQ0xE Part 4 http:///www.youtube.com/watch?v=9blgOboiGMQ NPR’s Scott Simon: How to Tell a Story http:///www.youtube.com/watch?v=tiX_WNdJu6w This will work (you must use shortcodes): Part 1 [youtubes=http://www.youtube.com/watch?v=n7KQ4vkiNUk] Part 2 [youtubes=http://www.youtube.com/watch?v=3qmtwa1yZRM] Part 3 [youtubes=http://www.youtube.com/watch?v=-hidvElQ0xE] Part 4 [youtubes=http://www.youtube.com/watch?v=9blgOboiGMQ] NPR’s Scott Simon: How to Tell a Story [youtubes=http://www.youtube.com/watch?v=tiX_WNdJu6w] WordPress states: To quickly embed a YouTube video, simply copy the video’s URL from your web browser’s address bar while viewing the video: For more information see http:///en.support.wordpress.com/videos/youtube/ NOTE To make the code compatible with this post I have changed http:// to http:/// in the first section and youtube to youtubes in the second section. Please change accordingly.

Posted in Tech Tips, Web Development | Tagged , , , | Leave a comment

Understanding WordPress’ add_image_size (with examples)

WordPress’s add_image_size function can be a little tricky to master, especially understanding how the cropping and resizing works. I’ve dedicated a blog entry to explaining how the images are cropped on an image that is larger than the maximum size, and below are the results. The WordPress documentation for the add_image_size() function has the following components: Usage < ?php add_image_size( $name, $width, $height, $crop ); ?> Parameters $name (string) (required) The new image size name. Default: None $width (int) (optional) The post thumbnail width in pixels. Default: 0 $height (int) (optional) The post thumbnail height in pixels. Default: 0 $crop (boolean) (optional) Crop the image or not. False – Soft proportional crop mode ; True – Hard crop mode. Default: false Original Image (404w x 1587h) Next, the original image, which is 404w by 1587h. Soft Crop, Very Tall Height This results in a proportional image that is 185w by 726h. In this case the image is limited by it’s width, 185px. add_image_size( ‘feature’, 185, 1200, false ); Soft Crop, Normal Height This results in a proportional image that is 54w by 215h. The image is limited by the height. add_image_size( ‘feature1′, 185, 215, false ); Hard Crop, Very Tall Height This results in a disproportionate image which is exactly 185 x 1200, but the edges of the image are lost. This works semi-ok here but would not be good if we were uploading a logo, something with text, or a person with important features on the edges of the … Continue reading

Posted in Tech Tips, Web Development | Tagged , , , , | Leave a comment

mac: opposite of command m

use the Command-Tab shortcut to get to the application. With the application selected press the Option key and release the Command key. One minimized window of the application will become un-minimized (if you have more than one minimized application window, you have to un-minimize the other windows the old fashioned way). Alternatively you can use a utility like FastScripts to assign a keyboard shortcut to an Applescript file. I have set up Cmd+Option+M to run the following script which seems to work fine for most applications on OS X Lion: tell application (path to frontmost application as text) try set miniaturized of windows to false — most apps end try try set collapsed of windows to false — Finder end try end tell — Hack from willshouse.com to make sure Finder really does unminimize windows if (name of (info for (path to frontmost application)) as text) is “Finder.app” then try tell application “Finder” set collapsed of windows to false — Finder end tell end try end if

Posted in Mac, Tech Tips | Tagged , , , , | 1 Comment

twttrHubFrame: solved

If you’re seeing a hidden iframe with an ID twttrHubFrame that probably means you’re using a socialize widget such as the twitter platform’s widget. Here is an example as used by the post-types-order plugin for WordPress. <a href=”https://twitter.com/share” class=”twitter-share-button” data-url=”http://www.nsp-code.com” data-text=”Define custom order for your taxonomies terms through an easy to use javascript AJAX drag and drop interface. No theme code updates are necessarily, this plugin will take care of query update.” data-count=”none”>Tweet</a> <script type=”text/javascript” src=”//platform.twitter.com/widgets.js”></script>

Posted in Social Media, Tech Tips, Web Development | Tagged , , , | Leave a comment

Make YSlow work with Firefox 10

Firefox 9, Firebug, and YSlow had some compatibility issues which caused YSlow not to work for many users. The good news is that the Firebug, and YSlow extensions have been updated and now if you are using Firebug 1.9.1 and YSlow 3.0.9 then YSlow will work “Out of the Box” with Firefox 10. If you had these extensions previously disabled make sure re-enable them and you should be good to go.

Posted in Mac, Software, Tech Tips, Web Development | Tagged , , | Leave a comment