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 if ( wp_is_mobile() ) { | |
| // Do something for mobile devices | |
| } else { | |
| // Do something for desktop | |
| } |
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
| /* Close the Yoast metabox */ | |
| function shut_your_mouth_yoast() { | |
| echo '<script>jQuery( document ).ready(function() { jQuery(".yoast.wpseo-metabox").addClass("closed"); });</script>'; | |
| } | |
| add_action( 'admin_head', 'shut_your_mouth_yoast' ); |
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
| jQuery('.my-button').click(function() { | |
| if(jQuery(this).prop('checked')) { | |
| jQuery('.my-checkbox').removeAttr('disabled'); | |
| } else { | |
| jQuery('.my-checkbox').attr('disabled', 'disabled'); | |
| } | |
| }); |
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
| <script> | |
| // Actual waypoint script. Save into waypoint.js | |
| /*! | |
| Waypoints - 4.0.0 | |
| Copyright © 2011-2015 Caleb Troughton | |
| Licensed under the MIT license. | |
| https://github.com/imakewebthings/waypoints/blob/master/licenses.txt | |
| */ | |
| ! function() { |
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
| <h1> | |
| <span>This is a test</span> | |
| </h1> | |
| <style> | |
| h1 span { | |
| -webkit-text-fill-color: transparent; /* Chrome Only */ |
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
| $(window).scroll(function() { | |
| if ($(document).scrollTop() > 100) { | |
| $('.header').addClass('scrolled'); | |
| } | |
| else { | |
| $('.header').removeClass('scrolled'); | |
| } | |
| }); |
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
| /* | |
| Enqueue jQuery | |
| Uses the WordPress built-on jQuery | |
| */ | |
| function my_jquery_method() { | |
| wp_enqueue_script( 'jquery'); | |
| } | |
| add_action( 'wp_enqueue_scripts', 'my_jquery_method' ); |
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
| <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" /> | |
| <script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> | |
| <script src="https://unpkg.com/leaflet.fullscreen@1.4.5/Control.FullScreen.js"></script> | |
| <style>.leaflet-control-zoom-fullscreen { background-image: url('<?php echo get_template_directory_uri();?>/images/maps/icon-fullscreen.png');}</style> | |
| <div id='map'></div> | |
| <script type="text/javascript"> | |
| $( document ).ready(function() { | |
| var map = new L.Map('map', { | |
| center: [-31.898472745592997, 115.81094863686857], |
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 | |
| /* | |
| Only allow access to a URL if nonce passed. | |
| Nonce docs: https://codex.wordpress.org/WordPress_Nonces | |
| */ | |
| /* The URL you want to protect */ | |
| $the_url = plugins_url() . '/my-plugin/top-secret.php'; | |
| ?> | |