Skip to content

Instantly share code, notes, and snippets.

View Roshanb54's full-sized avatar
🏠
Working From Home

Roshan Banstola Roshanb54

🏠
Working From Home
View GitHub Profile
@Roshanb54
Roshanb54 / Simple Ajax Login Form.php
Created September 19, 2024 03:29 — forked from cristianstan/Simple Ajax Login Form.php
Wordpress: Simple Ajax Login Form
<?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>
@Roshanb54
Roshanb54 / alm-filtering.js
Created February 7, 2022 10:29
Wordpress Ajax Load More advanced filtering with multiple custom taxonomies
// 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
@Roshanb54
Roshanb54 / form.html
Created January 31, 2022 08:07 — forked from AminulBD/form.html
Mailchimp Ajax Subscribe For WordPress
<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">
@Roshanb54
Roshanb54 / README.md
Created April 6, 2021 09:09 — forked from ControlledChaos/README.md
Change the default WordPress post name to News and replace the Dashicon.

Change Default Posts to News

WordPress Snippet

<?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
* 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;