Skip to content

Instantly share code, notes, and snippets.

View levnhub's full-sized avatar
🎯
Focusing

Lev N levnhub

🎯
Focusing
View GitHub Profile
@levnhub
levnhub / wp-pagination.css
Created March 10, 2019 10:18
Wordpress Pagination CSS Style Template
// WP Pagination Style
.pagination {
// block style
.screen-reader-text {
display: none;
}
.nav-links {
// list style
.page-numbers {
// item style
@levnhub
levnhub / .htaccess
Created June 21, 2018 10:21
.htaccess tricks
* For font from other domain
<FilesMatch "\.(ttf|otf|eot|woff|woff2)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
## THIS REMOVES CONTACT FORM 7 BULK FROM EVERY PAGE
## By default, contact form 7 adds the js and css to every page
## in wordpress, which is bulky, so we remove it.
define( 'WPCF7_LOAD_JS', false );
define( 'WPCF7_LOAD_CSS', false );
define( 'WPCF7_AUTOP', false );
/* Это всё, дальше не редактируем. Успехов! */
@levnhub
levnhub / js.snippets.js
Last active April 26, 2018 15:56
Pure JS Snippets
// Media Queries
function myFunction(x) {
if (x.matches) { // If media query matches
document.body.style.backgroundColor = "yellow";
} else {
document.body.style.backgroundColor = "pink";
}
}
@levnhub
levnhub / bootstrap.html
Last active January 15, 2019 14:36
Bootstrap Snippets
<!-- Fixes -->
<style>
// iOS bag fix
.card-header {
cursor: pointer;
}
</style>
<!-- Accordion Menu -->
<ul id="mMenuAccordion" class="mmenu_nav accordion">
@levnhub
levnhub / contact.html
Created December 25, 2017 19:13
Contact
// WhatsUp
https://api.whatsapp.com/send?phone=79313311325
// Viber
viber://chat?number=+79999999999
// Telegram
tg://resolve?domain=NAME
@levnhub
levnhub / dead-center.css
Last active January 29, 2019 14:27
Dead Center Image
// Dead Center Fill
.block {
position: relative;
height: 190px;
overflow: hidden;
.img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
@levnhub
levnhub / wp-config.php
Created December 22, 2017 11:15
WP Config Tweaks
// Increasing the WordPress Memory Limit
define('WP_MEMORY_LIMIT', '64M');
@levnhub
levnhub / php-snippets.php
Last active August 7, 2018 15:41
PHP Snippets
<?php
// Get phone number from ACF & clean for the link
$phone_number = get_field( 'tel', 33 );
$clean_number = str_replace( array(' ', '-', '(', ')'), '', $phone_number );
?>
<a href="tel:<?php echo $clean_number ?>" class="header-menu-tel-link"><?php echo $phone_number ?></a>
<!-- IF -->
<?php
@levnhub
levnhub / jquery.snippets.js
Last active January 9, 2018 12:41
jQuery Snippets
// Masked Input
jQuery(function($){
$('input[type="tel"]').mask("+7 (999) 999–99–99");
});
// Fixed Nav
$(window).scroll(function(){
var nav = $('#Nav'),
fix = $('#NavFix'),
scroll = $(window).scrollTop(),