Skip to content

Instantly share code, notes, and snippets.

@pagemashine
pagemashine / adaptive.js
Created December 1, 2017 14:22
media query on js
window.adaptive = (function(){
var jqAdaptiveParamsContainer = $(".js_adaptive_params");
var oData = {};
if ( jqAdaptiveParamsContainer.length ){
oData = jqAdaptiveParamsContainer.data('adaptive_parameters');
}
@pagemashine
pagemashine / resize_and_load
Created November 30, 2017 09:01
Works at loading and resizing
$(document).load($(window).bind("resize", listenWidth));
function listenWidth( e ) {
var windowWidth = $(window).width();
if (windowWidth > 767) {
stick();
}
else {
unstick();
}
@pagemashine
pagemashine / wp_query_entry
Created September 17, 2017 10:35
Вывод записей из определенной категории
<?php /* template name: аксессуары для мобильных устройств */ ?>
<?php get_header(); ?>
<div id="container" class="right_container">
<div id="content" class="content" role="main">
<h1 class="page-title">аксессуары для мобильных устройств</h1>
<!-- начинается петля -->
<?php $acsessuar = new wp_query( array( 'post_type' => 'acsessuar', 'category_name' => 'r_portfolio', 'posts_per_page' => 24 ) ); ?>
<?php while ( $acsessuar->have_posts() ) : $acsessuar->the_post(); ?>
<div id="post-<?php the_id(); ?>" <?php post_class(); ?>>
@pagemashine
pagemashine / WordPress query_post
Created September 5, 2017 20:11 — forked from DoRightt/WordPress query_post
gist by agragregra
<?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(); ?>
@pagemashine
pagemashine / gist:5279b7ed410542993dbbe979e7d5838e
Created June 16, 2017 07:43
breadcrumbs микроразметка
<div class="b-path" sktag="menu.path">
<ul itemscope itemtype="http://schema.org/BreadcrumbList">
{% if main_page %}
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" sktag="menu.path.a">
<a itemprop="item" href="/"><span itemprop="name">{{ main_page.title }}</span></a>
<meta itemprop="position" content="{{ loop.index }}" />
</li>
{% endif %}
{%for item in items%}
{% if item.selected %}
.b-benefits>.benefits__items>(.benefits__item>(.benefits__img>img[src=/images/benefits-$.png][alt="Преимущество-$"])+.benefits__text)*5
<style>
.b-benefits {}
.b-benefits:after {
content: "";
display: table;
clear: both;
}
.b-benefits .benefits__item {
display: inline-block;
$(function() {
// sidebar
function showSidebar() {
$('.js-sidebar').addClass('l-sidebar--open');
$('body').addClass('g-ovh');
};
function hideSidebar() {
/*---------------------------------*/
.l-sidebar {
opacity: 0;
visibility: hidden;
position: fixed;
top:0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.34);
<div class="l-sidebar js-sidebar l-sidebar--open">
<div class="sidebar__overlay hide-on-desktop js-sidebar-overlay"></div>
<div class="sidebar__inner js-sidebar-inner hide-on-desktop">
<div class="sidebar__close">
<a class="js-sidebar-hide" href="#">
<img src="/images/sandwich-close.png" alt="">
</a>
</div>
<div class="b-sidebar-pilot">
<div class="sidebar-pilot__logo">
/*---------------------------------*/
@media handheld, only screen and (min-width: 980px) and (max-width: 1279px) { /*-SMALL DESKTOP-*/
/*---------------------------------*/
/*---------------------------------*/
}
/*---------------------------------*/
@media handheld, only screen and (min-width: 768px) and (max-width: 979px) { /*-TABLET-*/
/*---------------------------------*/
/*---------------------------------*/
}