WordPress Snippet
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 | |
| //Simple Ajax Login Form | |
| //Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/ | |
| ?> | |
| //html | |
| <form id="login" action="login" method="post"> | |
| <h1>Site Login</h1> | |
| <p class="status"></p> | |
| <label for="username">Username</label> |
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
| // Advanced Filtering | |
| $(document).ready(function () { | |
| var alm_is_animating = false; // Animating flag | |
| var buttons = $('.filter-tag .btn'); | |
| // Btn Click Event | |
| $(document).on('click', '.filterTrigger .btn', function (e) { | |
| e.preventDefault(); | |
| // Prevent any action while animating or with disabled class |
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
| <form class="newsletter-form top-margin-80 aw-mc-ajax-form" action="<?php echo admin_url( 'admin-ajax.php'); ?>" method="post"> | |
| <input name="action" type="hidden" value="aw_chimp_subscribe"> | |
| <div class="field-inside"> | |
| <i class="fa fa-envelope-o"></i> | |
| <input type="text" name="email" class="email-field" placeholder="Type your email address..."> | |
| <button type="submit"> | |
| <span cLass="subscribe-text"> | |
| <?php _e( 'Subscribe', 'appsworld' ); ?> | |
| </span> | |
| <span cLass="ajax-loader"> |
A lightweight full page parallax scroll effect.
A Pen by Emily Hayman on CodePen.
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
| $wp_customize->add_setting( 'themeslug_dropdownpages_setting_id', array( | |
| 'capability' => 'edit_theme_options', | |
| 'sanitize_callback' => 'themeslug_sanitize_dropdown_pages', | |
| ) ); | |
| $wp_customize->add_control( 'themeslug_dropdownpages_setting_id', array( | |
| 'type' => 'dropdown-pages', | |
| 'section' => 'custom_section', // Add a default or your own section | |
| 'label' => __( 'Custom Dropdown Pages' ), | |
| 'description' => __( 'This is a custom dropdown pages option.' ), |
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: Custom table example | |
| Description: example plugin to demonstrate wordpress capatabilities | |
| Plugin URI: http://mac-blog.org.ua/ | |
| Author URI: http://mac-blog.org.ua/ | |
| Author: Marchenko Alexandr | |
| License: Public Domain | |
| Version: 1.1 | |
| */ |
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 | |
| /** | |
| * Abstract class which has helper functions to get data from the database | |
| */ | |
| abstract class Base_Custom_Data | |
| { | |
| /** | |
| * The current table name | |
| * | |
| * @var boolean |
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 | |
| $mobile = false; | |
| $useragent=$_SERVER['HTTP_USER_AGENT']; | |
| if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipa |
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 advanced_asyc_scripts($url) { | |
| if ( strpos( $url, '#asyncload') === false ) { | |
| return $url; | |
| } else if ( is_admin() ) { | |
| return str_replace( '#asyncload', '', $url ); | |
| } else { | |
| return str_replace( '#asyncload', '', $url )."' async='async' defer='defer"; | |
| } | |
| } |
NewerOlder