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
// create next previous page for custom post type | |
function get_prevnext_custompost($post_ID, $postType, $taxonomy, $term) { | |
if($taxonomy){ | |
$args = array( | |
'post_type' => $postType, | |
'posts_per_page' => -1, | |
'post_status' => 'publish', | |
'tax_query' => array( | |
array( | |
'taxonomy' => $taxonomy, |
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 CART section start --------------------- */ | |
add_action('wp_ajax_nopriv_add_to_cart_ajax', 'add_to_cart_ajax_func'); | |
add_action('wp_ajax_add_to_cart_ajax', 'add_to_cart_ajax_func'); | |
function add_to_cart_ajax_func(){ | |
//print_r($_POST); | |
$product_id = $_POST['product_id']; | |
$product_quantity = $_POST['product_quantity']; | |
$total_price = $_POST['total_price']; |
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
const $img = jQuery(".product__media-list img"); | |
jQuery(".color_input_fields input").on("click",function() { | |
$img.parents('li').hide(); | |
const val = this.value.trim().toLowerCase(); | |
if (val === "") return; | |
$img.filter(function() { return this.alt.toLowerCase().includes(val) }).parents('li').show() | |
}); |
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
https://stackoverflow.com/questions/56713668/custom-scrolling-animations-pausing-sections-and-scrolling-elements-horizontal | |
<script> | |
$('.nested').each(function() { | |
let $window = $(window), $body = $('body'); | |
let $nested = $(this), $nestedPlaceholder = $nested.parent(); | |
let verticalScrollRange, upperMargin, lowerMargin; | |
$window.resize(function(){ | |
$nested.removeClass("sticky").css({left: 0}); | |
let placeholderHeight = $nestedPlaceholder.css({height: ''}).height(); |
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
<div id="note" ></div> | |
<br><br><br><br><br><br><br><br><br><br><br> | |
<div class="scrollratio" ></div> | |
<br><br><br><br><br><br><br><br><br><br><br> | |
<br><br><br><br><br><br><br><br><br><br><br> | |
<br><br><br><br><br><br><br><br><br><br><br> | |
<br><br><br><br><br><br><br><br><br><br><br> | |
<style> | |
body { |
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
$regxp = 'River'; | |
$sql = "SELECT * FROM categories where catinclude RLIKE '(^|,)$regxp(,|\$)'"; |
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
function dropdownChange(){ | |
var byDate = document.getElementById('filter-by-date').value; | |
var myUrl = addQSParm('cat_type',cat_type); | |
var myUrl = addQSParm('keyword',sKeyword, myUrl); | |
window.location.href = myUrl; | |
} | |
/************************************************** | |
@ Constructing a URL with parameters using jQuery |
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 'currency' %} | |
<select name="currency"> | |
{% for currency in shop.enabled_currencies %} | |
{% if currency == cart.currency %} | |
<option selected="true">{{currency.iso_code}} {{currency.symbol}}</option> | |
{% else %} | |
<option>{{currency.iso_code}}</option> | |
{% endif %} | |
{% endfor %} | |
</select> |
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
<div id="instagram-feed1" class="instagram_feed"></div> | |
https://github.com/jsanahuja/jquery.instagramFeed | |
https://www.sowecms.com/demos/InstagramFeed/ | |
<script > | |
(function($){ | |
$(window).on('load', function(){ | |
$.instagramFeed({ | |
'username': '{{ section.settings.instagram_id | escape }}', | |
'container': "#instagram-feed1", | |
'display_profile': false, |
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 | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting url |
NewerOlder