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 isElementInViewport(elem) { | |
| var $elem = $(elem); | |
| // Get the scroll position of the page. | |
| var scrollElem = ((navigator.userAgent.toLowerCase().indexOf('webkit') != -1) ? 'body' : 'html'); | |
| var viewportTop = $(scrollElem).scrollTop(); | |
| var viewportBottom = viewportTop + $(window).height(); | |
| // Get the position of the element on the page. | |
| var elemTop = Math.round( $elem.offset().top ); |
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 newAjax = $.ajax({ | |
| url: 'url.php', | |
| type: "POST", | |
| cache: false, | |
| data: {test: "hello"}, | |
| dataType: 'json', | |
| timeout: 2000 | |
| }); |
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
| * Register with hook 'wp_enqueue_scripts', which can be used for front end CSS and JavaScript | |
| */ | |
| add_action( 'wp_enqueue_scripts', 'prefix_add_my_stylesheet' ); | |
| /** | |
| * Enqueue plugin style-file | |
| */ | |
| function prefix_add_my_stylesheet() { | |
| // Respects SSL, Style.css is relative to the current file | |
| wp_register_style( 'prefix-style', plugins_url('style.css', __FILE__) ); |
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 arphabet_widgets_init() { | |
| register_sidebar( array( | |
| 'name' => 'Home right sidebar', | |
| 'id' => 'home_right_1', | |
| 'before_widget' => '<div>', | |
| 'after_widget' => '</div>', | |
| 'before_title' => '<h2 class="rounded">', | |
| 'after_title' => '</h2>', | |
| ) ); |
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
| <?php | |
| /* | |
| Plugin Name: KS Plugin | |
| Plugin URI: http://kevinsalter.me | |
| Description: A brief description of the Plugin. | |
| Version: 1.0 | |
| Author: Name Of The Plugin Author | |
| Author URI: http://kevinsalter.me | |
| */ |
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 login PAGE *****************/ | |
| function ksd_login_css() { | |
| wp_enqueue_style( 'ksd_login_css', get_template_directory_uri() . ' /css/login.css', false ); | |
| } | |
| // changing the logo link from wordpress.org to your site | |
| function ksd_login_url() { return home_url(); } | |
| // changing the alt text on the logo to show your site name |
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 login PAGE *****************/ | |
| function ksd_login_css() { | |
| wp_enqueue_style( 'ksd_login_css', get_template_directory_uri() . ' /css/login.css', false ); | |
| } | |
| // changing the logo link from wordpress.org to your site | |
| function ksd_login_url() { return home_url(); } | |
| // changing the alt text on the logo to show your site name |
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 ( $, window, document, undefined ) { | |
| var methods, settings; | |
| var state = 1; | |
| settings = { | |
| animationSpeed: 500, | |
| animationEasing: 'linear', | |
| curtainClass: 'curtain', | |
| curtainLeftClass: 'left', |
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 hash = window.location.hash; | |
| hash && $('ul.nav a[href="' + hash + '"]').tab('show'); | |
| $('.nav-tabs a').click(function (e) { | |
| $(this).tab('show'); | |
| var scrollmem = $('body').scrollTop(); | |
| window.location.hash = this.hash; | |
| $('html,body').scrollTop(scrollmem); | |
| }); |
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
| // make it safe to use console.log always | |
| (function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try | |
| {console.log();return window.console;}catch(err){return window.console={};}})()); |
NewerOlder