WordPress Snippet
This file contains 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 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 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 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 | |
/** | |
* Register the Book custom post type. | |
*/ | |
function km_register_book_post_type() { | |
register_post_type( 'company', [ | |
'public' => true, | |
'supports' => [ 'title', 'editor', 'thumbnail' ], | |
'labels' => km_get_book_cpt_labels(), | |
] ); |
This file contains 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 | |
get_header(); | |
$al_cat_slug = get_queried_object()->slug; | |
$al_cat_name = get_queried_object()->name; | |
?> | |
<h2><?php echo $al_cat_name; ?></h2> | |
<?php | |
$al_tax_post_args = array( | |
'post_type' => 'Your Post Type', // Your Post type Name that You Registered |
This file contains 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('.menu a[href*=#]:not([href=#])').each(function(){ | |
$('a[href*=#]:not([href=#])').click(function() | |
{ | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
|| location.hostname == this.hostname) | |
{ | |
var target = $(this.hash); | |
var menu_href_val = $(this).attr('href'); |
This file contains 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 jump=function(e) | |
{ | |
if (e){ | |
e.preventDefault(); | |
var target = jQuery(this).attr("href"); | |
}else{ | |
var target = location.hash; | |
} | |
jQuery('html,body').animate( |
This file contains 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
* Disable payment gateways for shipping methods | |
* Filter payment gatways | |
*/ | |
function my_custom_available_payment_gateways( $gateways ) { | |
$chosen_shipping_rates = WC()->session->get( 'chosen_shipping_methods' ); | |
// When 'local delivery' has been chosen as shipping rate | |
if ( in_array( 'local_delivery', $chosen_shipping_rates ) ) : | |
// Remove bank transfer payment gateway | |
unset( $gateways['bacs'] ); | |
endif; |
NewerOlder