Skip to content

Instantly share code, notes, and snippets.

View Darv1n's full-sized avatar

Artem Zolin Darv1n

View GitHub Profile
@Darv1n
Darv1n / Init-woocommece-cat-navigation
Created March 5, 2019 16:40
Init cat navigation for woocommece with dropdown sub-categories
// Dropdown toggle
$('.dropdown-toggle').click( function(){
$(this).toggleClass("dropdown-toggle-on");
})
// Product categories
function initCatNavigation( container ) {
var dropdownToggle = $( '<button />', {
'class': 'dropdown-toggle',
'aria-expanded': false
@Darv1n
Darv1n / Init-wp-main-navigation.txt
Last active March 5, 2019 16:39
Init main navigation + dropdown toggle + Fix sub-menus for touch devices for Wordpress
// Dropdown toggle
$('.dropdown-toggle').click( function(){
$(this).toggleClass("dropdown-toggle-on");
})
// Navigation + dropdown
var body, masthead, menuToggle, siteNavigation;
function initMainNavigation( container ) {
fgjgjghj
.goods-catalog-container {
padding-top: 30px;
padding-bottom: 30px;}
.goods-catalog-container a {
color: #666;}
.goods-catalog-container a:hover {
text-decoration: none;}
.goods-catalog-container .goods-item-title a {
color: #666;
text-decoration: none;}
Вывод частей:
<?php get_sidebar(); ?>
<?php get_header(); ?>
<?php get_footer(); ?>
Пути до файлов:
<?php echo get_template_directory_uri(); ?>/
<?php echo get_stylesheet_directory_uri(); ?>/
Вывод записей:
/**
* Деактивирует родительские css стили
*/
function sf_child_theme_dequeue_style() {
wp_dequeue_style( 'storefront-style' );
wp_dequeue_style( 'storefront-woocommerce-style' );
}
/**
* Отключает дефолтные интейновые css стили
@Darv1n
Darv1n / button_to_top
Created October 15, 2015 08:34
Кнопка "Наверх"
html:
<a href="#header" class="button_to_top">
<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>
</a>
{"src" : "libs/PageScroll2id/PageScroll2id.min.js", "async" : false},
css:
.button_to_top {
bottom: 20px;
@Darv1n
Darv1n / jQuery Tabs Short
Created September 15, 2015 17:23
Функция табов
HTML:
<div class="wrapper">
<div class="tabs">
<span class="tab">Вкладка 1</span>
<span class="tab">Вкладка 2</span>
<span class="tab">Вкладка 3</span>
</div>
<div class="tab_content">
<div class="tab_item">Содержимое 1</div>
<div class="tab_item">Содержимое 2</div>
@Darv1n
Darv1n / wResize.txt
Created September 15, 2015 16:52
Функция, благодаря которой, высота ресайз-окна становиться такой же, какой высота виндоу-окна
function wResize() {
$("header").css("height", $(window).height()
});
wResize();
$("window").resize(function() {
wResize()
});