Skip to content

Instantly share code, notes, and snippets.

View RiodeJaneiroo's full-sized avatar
🎯
Focusing

Vadim Zmiievskyi RiodeJaneiroo

🎯
Focusing
  • Ukraine
View GitHub Profile
@RiodeJaneiroo
RiodeJaneiroo / form-billing.php
Last active April 14, 2019 11:28
[Wordpress – woocommerce] Woocommerce functions #wordpress #woocommerce
<?php
/**
* Checkout billing information form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-billing.php. <--- HERE PATH
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@RiodeJaneiroo
RiodeJaneiroo / functions.php
Last active March 26, 2019 13:44
[wpcf7 modal right answer] Displays a message about the successful submission of the form in a modal window for the Contact Form 7 plugin #wordpress #CF7
<?php
/**
* Plugin Name: CF7 Modal Right Answer
* Plugin URI: https://gist.github.com/campusboy87/a056c288c99feee70058ed24cee805ad
* Author: Campusboy (wp-plus)
* Author URI: https://www.youtube.com/wp-plus
*/
add_action( 'wp_enqueue_scripts', 'wpcf7_modal_right_answer_js' );
add_action( 'wp_footer', 'wpcf7_modal_right_answer_js_inline', 999 );
@RiodeJaneiroo
RiodeJaneiroo / style.css
Created October 7, 2018 14:52
[IOS Safari zoom block] Mobile Safari (а также Chrome для Android, Mobile Firefox и IE Mobile) автоматически увеличивают размер шрифта внутри широких блоков. Это можно пофиксить одной строчкой CSS: #safari #css
-webkit-text-size-adjust: 100%;
@RiodeJaneiroo
RiodeJaneiroo / functions.php
Created October 9, 2018 10:45
[Wordpress - wp nav menu] Remove class and ID from li #wordpress #wp_nav_menu
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
function my_css_attributes_filter($var) {
return is_array($var) ? array() : '';
}
@RiodeJaneiroo
RiodeJaneiroo / functions.php
Created October 10, 2018 12:02
[Disable canonical URLs - YOASY] To disable the canonical entirely, you could do the following: #wordpress #yoast #canonical
add_filter( 'wpseo_canonical', '__return_false' );
@RiodeJaneiroo
RiodeJaneiroo / robots.txt
Created October 11, 2018 20:25
[robots.txt – Close site] Close the whole site from indexing
User-agent: *
Disallow: /
@RiodeJaneiroo
RiodeJaneiroo / functions.php
Last active October 12, 2018 09:11
[AJAX Request – Wordpress] Ajax request wordpress #ajax #wordpress
add_action( 'wp_ajax_misha', 'test_function' ); // wp_ajax_{ЗНАЧЕНИЕ ПАРАМЕТРА ACTION!!}
add_action( 'wp_ajax_nopriv_misha', 'test_function' ); // wp_ajax_nopriv_{ЗНАЧЕНИЕ ACTION!!}
// первый хук для авторизованных, второй для не авторизованных пользователей
function test_function(){
$summa = $_POST['param1'] + $_POST['param2'];
echo $summa;
die; // даём понять, что обработчик закончил выполнение
@RiodeJaneiroo
RiodeJaneiroo / functions.php
Last active October 12, 2018 09:28
[Ajax url in head] Wordpress past url ajax #ajaxurl #wordpress
// custom change on your own scripts
wp_localize_script( 'custom', 'myajax',
array(
'url' => admin_url('admin-ajax.php')
)
);
@RiodeJaneiroo
RiodeJaneiroo / index.php
Created October 12, 2018 15:39
[Basic loop – wordpress] wordpress basic loop #wordpress #loop
<?php while ( have_posts() ) : the_post(); ?>
<?php endwhile;?>
@RiodeJaneiroo
RiodeJaneiroo / index.html
Last active October 17, 2018 15:22
[flip logo] #css #html #animation
<div class="logos">
<div class="front"><img src="img/spec-rus.svg" alt="УКС «Спецпартнер»" class="logo"></div>
<div class="back"><img src="img/spec-eng.svg" alt="UKS «Specpartner»" class="logo"></div>
</div>