This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.urlParam = function(name){ | |
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); | |
return results[1] || 0; | |
} | |
// example.com?param1=name¶m2=&id=6 | |
$.urlParam('param1'); // name | |
$.urlParam('id'); // 6 | |
$.urlParam('param2'); // null | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.prevent-text-breakouts { | |
-ms-word-break: break-all; | |
word-break: break-all; | |
word-break: break-word; | |
-webkit-hyphens: auto; | |
-moz-hyphens: auto; | |
hyphens: auto; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var default_value = "Select by city,state or zip"; | |
$('#searchform #s').val(default_value); | |
$('#searchform #s').focus(function(){ | |
if(this.value == default_value) { | |
this.value = ''; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make a custom field in post first.... ex. video_url | |
// Get the video URL and put it in the $video variable | |
$video = get_post_meta($post->ID, 'video_url', true); | |
// Echo the embed code via oEmbed | |
echo wp_oembed_get( $video, array( 'width' => 218, 'height' => 127 )); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change Login Logo | |
add_action("login_head", "my_login_head"); | |
function my_login_head() { | |
echo " | |
<style> | |
body.login #login h1 a { | |
background: url('".get_bloginfo('template_url')."/assets/images/admin-logo.png') no-repeat scroll center top transparent; | |
height: 128px; | |
width: 325px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if object.errors.any? %> | |
<div id="error_explanation"> | |
<h2>Oops, looks like <%= pluralize(object.errors.count, "error") %> | |
occured:</h2> | |
<br /> | |
<ul> | |
<% object.errors.each do |key, msg| %> | |
<li><%=key%> <%= msg %></li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def status_tag(boolean, options={}) | |
options[:true] ||= '' | |
options[:true_class] ||= 'status true' | |
options[:false] ||= '' | |
options[:false_class] ||= 'status false' | |
if boolean | |
content_tag(:span, options[:true], :class => options[:true_class]) | |
else | |
content_tag(:span, options[:false], :class => options[:false_class]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("a[href^='http']").each(function() { | |
$(this).css({ | |
background: "url(http://www.google.com/s2/u/0/favicons?domain=" + this.hostname + | |
") left center no-repeat", | |
"padding-left": "20px" | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom WordPress Footer | |
function remove_footer_admin () { | |
echo '© 2012 - WordPress Channel, Aurélien Denis'; | |
} | |
add_filter('admin_footer_text', 'remove_footer_admin'); |
NewerOlder