Skip to content

Instantly share code, notes, and snippets.

View a-zhary's full-sized avatar
💻
Happy Coding

Anton Zhary a-zhary

💻
Happy Coding
View GitHub Profile
@a-zhary
a-zhary / Mass update pages by Advanced Custom Fields
Created November 15, 2017 15:01
Mass Update Pages By Advanced Custom Fields
/*
* Mass update page by Advanced Custom Field 'hide_site_map';
* Set value= '0';
*/
function mass_update_pages() {
//$args = array();
$my_pages = get_pages($args);
@a-zhary
a-zhary / Layout GF
Created October 21, 2017 20:51
Layout GF
</li>
<div class="row">
<div class="col-sm-6">
<li>
<--- Блок --->
</li>
</div>
<div class="col-sm-6">
@a-zhary
a-zhary / Минимальный заказ JS
Last active October 20, 2017 19:51
Минимальный заказ
<script>
jQuery(document).ready(function($) {
$( ".quant-minus, .quant-plus, #input_97_11" ).click(function() {
var totalSum = ($(".ginput_total.ginput_total_97").text());
totalSum = parseFloat(totalSum.replace(" ", ""));
if ( totalSum < 37500 ) {
$("#gform_next_button_97_30").prop("disabled", true);
$("#field_97_36 > div").css("color", "#e51c23");
} if ( totalSum >= 37500 ) {
$("#gform_next_button_97_30").prop("disabled", false);
// Html
<div class="top" title="Наверх"><i class="fa fa-angle-double-up"></i></div>
// Sass
.top
position: fixed
bottom: 25px
right: -100px
background-color: #e0e0e0
color: #666
z-index: 12
<div itemscope itemtype="http://schema.org/Organization">
<span itemprop="name">Яндекс</span>
Контакты:
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
Адрес:
<span itemprop="streetAddress">Льва Толстого, 16</span>
<span itemprop="postalCode"> 119021</span>
<span itemprop="addressLocality">Москва</span>,
</div>
Телефон:<span itemprop="telephone">+7 495 739–70–00</span>,
@a-zhary
a-zhary / wp-entry-title
Created June 28, 2017 00:35
wp-entry-title
<?php the_title( sprintf('<h1 class="entry-title"><a href="%s">', esc_url(get_permalink()) ),'</a></h1>');?>
@a-zhary
a-zhary / gulp deploy
Created June 5, 2017 13:07
gulp deploy
gulp.task('deploy', function() {
var conn = ftp.create({
host: 'ftp.democase.16mb.com',
user: 'u167902521',
password: '',
parallel: 10,
log: gutil.log
});
$(document).ready(function(){
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
@a-zhary
a-zhary / .htaccess
Created May 28, 2017 15:16
.htaccess
<ifModule mod_expires.c>
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-ttf .ttf
AddType application/x-font-opentype .otf
AddType application/x-font-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
@a-zhary
a-zhary / svgdraw.js
Created May 27, 2017 22:08 — forked from agragregra/svgdraw.js
SVG Animate
var path = document.querySelector('path');
var length = path.getTotalLength();
// Clear any previous transition
path.style.transition = path.style.WebkitTransition =
'none';
// Set up the starting positions
path.style.strokeDasharray = length + ' ' + length;
path.style.strokeDashoffset = length;
// Trigger a layout so styles are calculated & the browser
// picks up the starting position before animating