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 / 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 / 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
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 / 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 / style.css
Created October 4, 2018 17:59
[Font Smoothing] #css #font #font_smoothing
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
@RiodeJaneiroo
RiodeJaneiroo / functions.php
Last active October 9, 2018 15:01
[Wordpress F.A.Q|Portfolio| CPT] Wordpress – register post type - faq|Portfolio| #wordpress #cpt #no_url #register_post_type #faq #portfolio
add_action('init', 'art_register_port');
function art_register_port(){
register_post_type('portfolio', array(
'labels' => array(
'name' => 'Portfolio', // Основное название типа записи
'singular_name' => 'Portfolio', // отдельное название записи типа Book
'add_new' => 'Add',
'add_new_item' => 'Add new',
'edit_item' => 'Edit',
@RiodeJaneiroo
RiodeJaneiroo / .htaccess
Created October 3, 2018 16:46
[MODX revo htacces 301 redirect] Modx Revo 301 redirect from /index.php #modx #htaccess
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(php|html|htm)\ HTTP/
RewriteRule ^(.*)index\.(php|html|htm)$ $1 [R=301,L]
@RiodeJaneiroo
RiodeJaneiroo / index.html
Last active January 16, 2019 11:33
[Favicon link] #favicon #html
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="64x64" href="/favicon64.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon32.png">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
@RiodeJaneiroo
RiodeJaneiroo / index.php
Last active November 17, 2019 08:49
[Replace number phone] #php #replace #phone #wordpress
function cleanNumberPhone($string) {
$newString = preg_replace('~\D+~','', $string);
return $newString;
}
@RiodeJaneiroo
RiodeJaneiroo / main.js
Created October 2, 2018 14:35
[Smooth Scroll to anchor] #js #scroll
$('a[href^="#"]').on('click', function(event) {
event.preventDefault();
var sc = $(this).attr("href"),
dn = $(sc).offset().top;
$('html, body').animate({scrollTop: dn}, 1000);
});