This file contains hidden or 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
| $(function() { | |
| $(document).keypress(function(e){ | |
| switch(e.which){ | |
| // "ENTER" | |
| case 13: | |
| alert('enter pressed'); | |
| break; | |
| // "s" | |
| case 115: |
This file contains hidden or 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 Login Logo | |
| function login_css() { | |
| wp_enqueue_style( 'login_css', get_template_directory_uri() . '/css/login.css' ); | |
| } | |
| add_action('login_head', 'login_css'); |
This file contains hidden or 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 imgsrc = 'img/image1.png'; | |
| $('<img/>').load(function () { | |
| alert('image loaded'); | |
| }).error(function () { | |
| alert('error loading image'); | |
| }).attr('src', imgsrc); |
This file contains hidden or 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
| function replace_howdy( $wp_admin_bar ) { | |
| $my_account=$wp_admin_bar->get_node('my-account'); | |
| $newtitle = str_replace( 'Howdy,', 'Logged in as', $my_account->title ); | |
| $wp_admin_bar->add_node( array( | |
| 'id' => 'my-account', | |
| 'title' => $newtitle, | |
| ) ); | |
| } | |
| add_filter( 'admin_bar_menu', 'replace_howdy',25 ); |
This file contains hidden or 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
| .content { | |
| font: 1em/1.4 Segoe, "Segoe UI", "Helvetica Neue", Arial, sans-serif; | |
| } | |
| .title { | |
| font: 1.7em/1.2 Baskerville, "Baskerville old face", "Hoefler Text", Garamond, "Times New Roman", serif; | |
| } | |
| .code { | |
| font: 0.8em/1.6 Monaco, Mono-Space, monospace; |
This file contains hidden or 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
| //extend the jQuery functionality | |
| $.extend($.expr[':'], { | |
| //name of your special selector | |
| moreThanAThousand : function (a){ | |
| //Matching element | |
| return parseInt($(a).html()) > 1000; | |
| } | |
| }); | |
This file contains hidden or 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($(element).is(":visible")) { | |
| // The element is Visible | |
| } |
This file contains hidden or 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
| function customize_meta_boxes() { | |
| global $current_user; | |
| get_currentuserinfo(); | |
| if ($current_user->user_level < 3) | |
| remove_meta_box('postcustom','post','normal'); | |
| } | |
| add_action('admin_init','customize_meta_boxes'); |
This file contains hidden or 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
| $('imageelement').fadeOut(function() { | |
| $(this).load(function() { | |
| $(this).fadeIn(); | |
| }).attr('src', AnotherSource); | |
| }); |
This file contains hidden or 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
| $myterms = get_terms('retouch_types', 'orderby=none&hide_empty'); | |
| foreach ($myterms as $term) { | |
| setup_postdata($post); | |
| $term->name; | |
| //select posts in this category, and of a specified content type | |
| $posts = get_posts( array( | |
| 'post_type' => 'retouch', | |
| 'tax_query' => array( |