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
| <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
| 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
| /* 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
| <?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
| <?php function my_current_plugin_version() { | |
| $plugin_data = get_plugin_data( __FILE__ ); | |
| return $plugin_data['Version']; | |
| } | |
| function my_remote_plugin_version() { | |
| $str = file_get_contents('https://rocketapps.com.au/files/open-graphite-pro/open-graphite-pro/info.json'); | |
| $json = json_decode($str, true); | |
| return $json['version']; | |
| } |
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 | |
| /* | |
| You'll need to get an API key. | |
| Go to https://developers.google.com/fonts/docs/developer_api and scroll down to the 'Gey a Key' button. | |
| */ | |
| $api_key = "your-key-here"; | |
| $google_font = isset($options['google_font']) ? $options['google_font'] : ''; | |
| $url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=' . $api_key; | |
| $args = array( | |
| 'timeout' => 15, |
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 | |
| // The template | |
| $template = 'my-custom-script.php'; | |
| // If a template file exists in the theme folder, use it. | |
| if ( $theme_file = locate_template( array( 'my-custom-files/' . $template ) ) ) { | |
| include(get_template_directory() . '/my-custom-files/' . $template); | |
| } else { // Otherwise, use the plugin template file. | |
| include(plugin_dir_path( __FILE__ ) . '/templates/' . $template); | |
| } |
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 /* | |
| Check if css file of slug name exists and if it does, include stylesheet for that slug. | |
| Place in functions.php or make it a plugin. | |
| What is this for? | |
| If you need to add some custom CSS for a particular page, then this script will make that possible. | |
| Simply create a .css file with the name of the page slug (example: about-our-company.css) and place it in the theme /css/ folder. | |
| This CSS file will be automatically loaded when the page is visited. |
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
| /* | |
| Add to functions.php | |
| */ | |
| add_action( 'gform_after_submission_2', 'capture', 10, 2 ); /* gform_after_submission_2 = form ID 2 */ | |
| function capture( $entry, $form ) { | |
| global $wpdb; | |
| $table= $wpdb->prefix . 'my_table'; | |
| $end_date = $entry['4']; /* Field ID 4 */ |