Lets Move WordPress
Aug 29th
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
By slapping this into the wp-config.php file in the root directory of the installation, we can tweek the url to the dev servers….
Youtube Video Playlist Embedding
Aug 20th
< iframe width="560" height="315" src="http://www.youtube.com/embed/T0Jqdjbed40?playlist=SyoA4LXQco4,6l6PPvUhR4c" frameborder="0" allowfullscreen >
All you have to do is load up the first video, then the playlist identifier and there you have it…
Disable the Right-Click
Aug 16th
Here is how to disable the right-click.
For ie, throw this in the body tag:
< body onContextMenu="return false" >
for ff and chrome, you have to throw some javascript in the mix.
< script type="text/javascript" >
function md(e)
{
try { if (event.button==2||event.button==3) return false; }
catch (e) { if (e.which == 3) return false; }
}
document.oncontextmenu = function() { return false; }
document.ondragstart = function() { return false; }
document.onmousedown = md;
< /script >
Youtube image urls
Jul 20th
Here is the url to grab images from Youtube posts.
http://img.youtube.com/vi/VIDEO_ID/#.jpg
Add Testimonials Everywhere!
Jul 18th
While it is typically a good practice to have a page dedicated to testimonials, keep in mind that scattering them throughout your content gives it a better chance to close the sale.
Clear fields onclick onblur and other functions
Apr 5th
[ input type="text" name="field-name-here" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Enter Email To Get Updates':this.value;" value="Enter Email To Get Updates" />
Apr 2nd
/**CSS ROUNDED CORNERS for Mozilla, Webkit, Linux, Opera, IE9**/
#Your-Div-Name{
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px;
}
WordPress Tags for Development
Mar 8th
WordPress Tags for Development
While doing wordpress development here in Dallas, Tx. I find that I need a tag reference quite often. I lifted this from another site, but it should do the trick. If any other graphic designers, or web developers run across this, I hope it helps.
<?php if ( is_page(‘about’)) { echo ‘<div id=”secondnav”>This is the super cool secondary navigation.</div>’; } ?>view raw example1.php This Gist brought to you by GitHub. The code is asking if the page is named “about”, if it is, it echo’s the div “secondnav”. If the page isn’t called “about” then it echo’s nothing and nothing is displayed. It’s that simple. If you want the nav to display on the “about”and “contact”page add this
<?php if ( is_page(‘about’) || is_page(‘contact’)) { echo ‘<div id=”secondnav”>This is the super cool secondary navigation.</div>’; } ?>view raw example2.php This Gist brought to you by GitHub. One place I find myself using this a lot is loading javascript only on pages that need it. One problem of adding javascript links to your footer.php file is that they are called on everypage whether you need them or not. The simple way to call them only when need is to add them like this
<?php if ( is_page(‘about’)) { echo ‘<script type=”text/javascript” src=”http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js”></script>’; } ?>view raw example3.php This Gist brought to you by GitHub. This works well for pages, but for your blog page and single posts you will need a different function.
For your blog page use is_home()
For your single posts use is_single()
WordPress provides a slew of other tags as well including
is_home(), is_front_page(), is_search(), is_404(), is_singular(), is_page(), is_attachment(), is_local_attachment(), is_single(), is_sticky(), is_archive(), is_category(), is_tag(), is_author(), is_date(), is_year(), is_month(), is_day(), is_time(), is_admin(), is_preview(), is_paged(), is_page_template(), is plugin active(), is_plugin_page(), is_new_day(), is_feed(), is_trackback(), is_comments_popup(), comments_open(), pings_open(), is_taxonomy(), is_taxonomy_hierarchical(), is_term(), is_user_logged_in(), is_blog_installed(), is_active_sidebar(), is_dynamic_sidebar(), is_active_widget()
Favicons & Icons for Sites
Feb 23rd
Here is the code required to add icons on apple supported devices.
With Apple’s Reflective Shine:
< link rel=”apple-touch-icon” href=”somepath/image.png” / >
Without Apple’s Reflective Shine:
< link rel=”apple-touch-icon-precomposed” href=”somepath/image.png” / >
The recommended basic size for this icon is 57×57 pixels, with 90 degree corners; for best display on the higher-resolution iPhone 4 screen, an icon size of 114×114 pixels is recommended.[29][31][32]
For the iPad and iPad2, the basic size is 72×72 pixels with 90 degree corners. If the rumored next generation follows the same pattern as the iPhone and iPodTouch, the high-resolution size would be 144×144 pixels.[33]
==========================================================
I Grabbed this off the wikipedia page:
| Google Chrome | Internet Explorer | Firefox | Opera | Safari | |
|---|---|---|---|---|---|
<link rel="shortcut icon" href="http://example.com/myicon.ico" /> |
Yes[4] | Yes[4][17] | Yes[4] | Yes[4] | Yes |
<link rel="icon" type="image/vnd.microsoft.icon" href="http://example.com/image.ico" /> |
Yes | No[23] | Yes | Yes | Yes |
<link rel="icon" type="image/png" href="http://example.com/image.png" /> |
Yes | No[23] | Yes | Yes | Yes |
<link rel="icon" type="image/gif" href="http://example.com/image.gif" /> |
Yes | No[23] | Yes | Yes | Yes |
favicon.ico located in the web site’s root |
Yes | Yes | Optional[24] | Optional[25] | Yes |
| precedence: prefer root or (X)HTML linked version | ? | root[21] | ? | ? | ? |





