Skip to content

Instantly share code, notes, and snippets.

Jenya476

Block or report user

Report or block Jenya476

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Jenya476
Jenya476 / WordPress Get Custom Field
Last active Nov 13, 2016
Вывод кастомного поля в WP
View WordPress Get Custom Field
<?php echo get_post_meta($post->ID, 'year', true); ?>
@Jenya476
Jenya476 / WordPress query_posts
Created Nov 13, 2016
Вывод поста в WP
View WordPress query_posts
<?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(); ?>
View WordPress Get Category name By label
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>
@Jenya476
Jenya476 / background responsive
Last active Nov 13, 2016
Фоновое изображение
View background responsive
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 / functions.php
Created Nov 13, 2016
WordPress functions.php Must Have
View functions.php
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');
View parallax-translate3d.js
$(window).scroll(function() {
var st = $(this).scrollTop() /10;
$(".object").css({
"transform" : "translate3d(0px, " + st + "%, .01px)",
"-webkit-transform" : "translate3d(0px, " + st + "%, .01px)"
});
});
@Jenya476
Jenya476 / jQyery Form Ajax
Created Nov 30, 2016
Аякс отправка форм
View jQyery Form Ajax
//Аякс отправка форм
//Документация: 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 / scrolling
Created Dec 18, 2016
Кастомизация скроллинга
View scrolling
::-webkit-scrollbar-button {
background-image:url('');
background-repeat:no-repeat;
width:5px;
height:0px
}
::-webkit-scrollbar-track {
background-color:#ecedee
}
@Jenya476
Jenya476 / Menu_mini_js
Last active Dec 24, 2016
Скрипт создания дубликата меню для телефонов
View Menu_mini_js
$(".left_sidebar_list").after("<div id='mobile-menu-sb'>").clone().appendTo("#mobile-menu-sb");
$("#mobile-menu-sb").find("*").attr("style", "");
$("#mobile-menu-sb").children("ul").removeClass("header_mnu_list")
.parent().mmenu({
// slidingSubmenus: true,
extensions : [ 'widescreen', 'effect-menu-slide' ],
navbar: {
title: "Продукция"
}
});
@Jenya476
Jenya476 / index.html
Last active Jan 26, 2017
Универсальный PHP скрипт обратной связи
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>uniMail</title>
</head>
<body>
<form>
You can’t perform that action at this time.