Skip to content

Instantly share code, notes, and snippets.

jQuery(function(t){var e,s,a,i,c,o=t(document),r=t("#masthead"),d=0;function n(){if(s=e.height(),t("#page-cover").css("padding-top",""),t("body").hasClass("is-header-transparent")){var a=t("#page-cover").css("padding-top");a=parseInt(a),(isNaN(a)||a<=0)&&t("#page-cover").css("padding-top",s)}else t("#page-cover").css("padding-top","")}function h(){n(),r.removeAttr("style"),r.css("min-height","auto"),r.length?(s=r.height(),r.css({"min-height":s,display:"block"}),a=r.offset()):a={top:0,left:0},n();var i=0;t("#wpadminbar").length&&(i=t("#wpadminbar").height()),e.css("top",i)}e=t("#masthead-inner"),r=t("#masthead"),n(),h();var y=function(o){void 0===o&&(o=t(window).scrollTop()),"object"!=typeof a&&(a={top:0,left:0});var d=a.top+s+100;if(o>0){var n=0;t("#wpadminbar").length&&(n=t("#wpadminbar").height(),"absolute"==t("#wpadminbar").css("position")&&(n=0)),r.removeClass("sticky-hiding"),r.addClass("sticky"),e.css("top",n),c&&(clearTimeout(c),c=!1),r.hasClass("sticky-active")||i||(t(".header--sticky",r).each(functio
@Longkt
Longkt / WP Coupon - Support RTL
Last active October 2, 2020 08:00
WP Coupon - Support RTL
/*
Theme Name: WP Coupon
Adding support for language written in a Right To Left (RTL) direction is easy -
it's just a matter of overwriting all the horizontal positioning attributes
of your CSS stylesheet in a separate stylesheet file named rtl.css.
http://codex.wordpress.org/Right_to_Left_Language_Support
*/
.store-letter-content ul li:before,i.icon.angle.right:before {
"use strict";!function(t,n){var r=/:scope\b/gi;function i(e){var s=t[e];t[e]=function(e){var t=this,n=t.id||"qsid"+(new Date).getTime(),i=!t.id,o=r.test(e);try{return o&&(i&&(t.id=n),e=e.replace(r,"#"+n)),s.call(this,e)}finally{i&&(t.id=null)}}}function o(e){var t=n[e];n[e]=function(e){return t.call(this,e.replace(r,""))}}try{document.querySelector(":scope")}catch(e){i("querySelector"),i("querySelectorAll"),o("querySelector"),o("querySelectorAll")}}(Element.prototype,Document.prototype),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var e=Array.prototype.slice.call(arguments),n=document.createDocumentFragment();e.forEach(function(e){var t=e instanceof Node;n.appendChild(t?e:document.createTextNode(String(e)))}),this.appendChild(n)}})}),function(){if("function"==typeof NodeList.prototype.forEach)return;NodeList.prototype.forEach=Array.prototype.forEach}
=== Plugin Name ===
Contributors: famethemes
Tags: onepage
Requires at least: 4.4.2
Tested up to: 5.8.1
Stable tag: 2.2.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
The OnePress Plus plugin adds powerful premium features to OnePress
// Sort by Popularity default in Category coupon page
add_action( 'init', function() {
remove_action( 'wpcoupon_coupon_category_before_sidebar', 'wpcoupon_coupon_cat_filter_box', 10 );
remove_filter( 'pre_get_posts', 'wpcoupon_coupon_cat_query' );
add_action( 'wpcoupon_coupon_category_before_sidebar', 'custom_wpcoupon_coupon_cat_filter_box', 10 );
add_filter( 'pre_get_posts', 'custom_wpcoupon_coupon_cat_query' );
} );
@Longkt
Longkt / WP Coupon - export
Last active November 29, 2019 13:05
Fix the expired date and filter coupon store
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
require WP_COUPON_IE_PATH.'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Helper\Sample;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
function custom_screenr_page_header_cover() {
if ( is_page_template( 'template-frontpage.php' ) ) {
return false;
}
$image = $title = $desc = '';
if ( is_singular() && ! is_attachment() ) {
if ( is_single() ) {
$title = esc_html( get_theme_mod( 'page_blog_title', esc_html__( 'The Blog', 'screenr' ) ) );
function custom_onepress_display_page_title() {
if ( get_theme_mod( 'onepress_page_title_bar_disable' ) == 1 ) {
return;
}
$return = false;
if ( is_home() ) {
$page_id = get_option( 'page_for_posts' );
} else {
jQuery(document).ready(function(t){function e(){t(document.body).trigger("wc_toggle_done")}t.blockUI&&(t.blockUI.defaults.overlayCSS.backgroundColor="#FFF",t.blockUI.defaults.overlayCSS.opacity=.7),jQuery(document).on("selective-refresh-content-rendered",function(e,a){"Customify_Builder_Item_WC_Cart__render"!==a&&"customify_customize_render_header"!==a||t(document.body).trigger("wc_fragment_refresh")}),t(document.body).on("added_to_cart",function(e,a,c){t(".item--wc_cart").addClass("cart-active")}),Customify_JS.wc_open_cart&&t(document.body).trigger("added_to_cart"),t(document.body).on("wc_cart_button_updated",function(e,a){var c=a.parent();a.hasClass("single_add_to_cart_button")||t(".added_to_cart",c).addClass("button");var n=t(".add_to_cart_button",c).data("icon-pos")||"before",o=t(".add_to_cart_button",c).data("cart-icon")||"",i="",r="";o&&(r='<i class="'+o+'"></i>'),i="after"===n?r?wc_add_to_cart_params.i18n_view_cart+" "+r:wc_add_to_cart_params.i18n_view_cart:r?r+" "+wc_add_to_cart_params.i18n_view_cart: