Skip to content

Instantly share code, notes, and snippets.

@Jenya476
Jenya476 / scrolling
Created December 18, 2016 18:11
Кастомизация скроллинга
::-webkit-scrollbar-button {
background-image:url('');
background-repeat:no-repeat;
width:5px;
height:0px
}
::-webkit-scrollbar-track {
background-color:#ecedee
}
@Jenya476
Jenya476 / jQyery Form Ajax
Created November 30, 2016 11:58
Аякс отправка форм
//Аякс отправка форм
//Документация: http://api.jquery.com/jquery.ajax/
$("#form, #form2").submit(function(e) {
e.preventDefault;
$.ajax({
type: "POST",
url: "mail.php",
data: $(this).serialize()
}).done(function() {
alert("Спасибо за заявку!");
@Jenya476
Jenya476 / parallax-translate3d.js
Created November 13, 2016 18:09
Паралакс
$(window).scroll(function() {
var st = $(this).scrollTop() /10;
$(".object").css({
"transform" : "translate3d(0px, " + st + "%, .01px)",
"-webkit-transform" : "translate3d(0px, " + st + "%, .01px)"
});
});
@Jenya476
Jenya476 / functions.php
Created November 13, 2016 18:04
WordPress functions.php Must Have
show_admin_bar(false);
add_theme_support('post-thumbnails');
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
@Jenya476
Jenya476 / background responsive
Last active November 13, 2016 14:33
Фоновое изображение
background-color: transparent;
background-image: url(img/1.jpg);
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
height: 100vh;
position: relative;
@Jenya476
Jenya476 / WordPress Get Category name By label
Created November 13, 2016 13:23
Получение ID в WP
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>
@Jenya476
Jenya476 / WordPress query_posts
Created November 13, 2016 12:58
Вывод поста в WP
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail(array(100, 100)); ?>
<? endwhile; endif; wp_reset_query(); ?>
@Jenya476
Jenya476 / WordPress Get Custom Field
Last active November 13, 2016 12:53
Вывод кастомного поля в WP
<?php echo get_post_meta($post->ID, 'year', true); ?>