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
| * 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
| 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
| 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 ); |
OlderNewer