Skip to content

Instantly share code, notes, and snippets.

View git-bhanu's full-sized avatar
🐘
Always developing

Bhanu git-bhanu

🐘
Always developing
View GitHub Profile
@git-bhanu
git-bhanu / setup.php
Created September 13, 2020 04:49
Relevanssi Customcode settings
// Enable one letter search
add_filter('relevanssi_block_one_letter_searches', __NAMESPACE__.'\\one_word_searches');
function one_word_searches() {
return false;
}
// https://www.relevanssi.com/knowledge-base/indexing-product-variation-skus-main-product/
add_filter( 'relevanssi_content_to_index', __NAMESPACE__.'\\rlv_index_variation_skus', 10, 2 );
function getProductForMenuSearch() {
check_ajax_referer('ajax-nonce', 'nonce');
$search_term = sanitize_text_field($_POST['query']);
$args = array(
's' => $search_term,
'post_type' => 'product',
@git-bhanu
git-bhanu / Form_wordpressAjaxwithAlpinejs.html
Created September 1, 2020 12:50
Example : Using Alpine Js to set WordPress AJAX method.
<form method="POST" x-data="checkoutGuestForm()" @submit.prevent="submitData">
<p>
<span>
<input type="email"
placeholder="Enter Email"
name="email"
x-model="formData.email"
required
>
</span>
@git-bhanu
git-bhanu / es6importexport.js
Created August 19, 2020 16:57
Importing and Exporting ES6 modules for sage roots.
PAGE NAME : group-slider.js at "script/components/group-slider.js"
//////////////////////////////
import Swiper, {Navigation, Pagination} from 'swiper';
Swiper.use([Navigation, Pagination]);
const groupSlider = new Swiper('#group-cards', {
spaceBetween: 5,
speed: 300,
@git-bhanu
git-bhanu / deployment.yml
Last active August 5, 2020 17:19
Deploying Roots(WordPress Starter theme) to your host using Github Actions
name: Deployment
on:
push:
branches: [ production ]
jobs:
deploy:
runs-on: ubuntu-latest
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"><head>
<meta charset="utf-8"> <!-- utf-8 works for most cases -->
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine -->
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely -->
<meta name="format-detection" content="telephone=no,address=no,email=no,date=no,url=no">
<!-- Tell iOS not to automatically link certain text strings. -->
<meta name="color-scheme" content="light">
@git-bhanu
git-bhanu / header.js
Created July 20, 2020 11:49
Just a header
import TweenLite from 'gsap';
const menu = document.querySelector('.hamberger');
const nav = document.querySelector('nav');
const closeMenu = document.querySelector('.menu-close');
menu.addEventListener('click', () => {
TweenLite.to(nav, 0.3,{ left: 0 })
})
@git-bhanu
git-bhanu / fastest-cookie-consent-wordpress-plugin
Last active March 17, 2022 15:37
This is the forked verison of plugin made by Gijo. You can view the main version here https://wpspeedmatters.com/fastest-cookie-consent-wordpress-plugin/
@git-bhanu
git-bhanu / product-template.html
Created June 27, 2020 12:56
Product Template
<div class="product-page">
[shop_messages]
<div class="product">
<div class="product-left">
<h4>[types field='product-category'][/types]</h4>
<h2>[types field='product-name'][/types]</h2>
<div class="divider"></div>
<div class="">
[wpv-view name="products-icon-listing"]
</div>
<div class="profile-section">
<div class="dashboard-wrapper">
<div class="dashboard-left">[left_menu name='Dashboard' device='Desktop'][left_menu name='Dashboard' image_src='http://crush.test/wp-content/uploads/2020/04/Group-1910.svg' device='Mobile']</div>
<div class="dashboard-right">
[shop_messages]
<!-- When No coach assigned -->
[wpv-conditional if="( '[crush_trainer_assigned]' eq '' )"]
<div class="dashboard1-head">
<div class="head1-left">
<div style="padding-top: 30px;">