Skip to content

Instantly share code, notes, and snippets.

$(document).ready(function() {
// Хедер на весь экран
function heightDetect(){
$("header").css("height", $(window).height());
};
heightDetect();
$(window).resize(function() {
heightDetect();
});
@fobos98
fobos98 / gist:69acb047359143331b74a96f93cbdb61
Created February 17, 2017 08:44
WP post from categody loop (for slider)
<?php
global $post;
$args = array( 'category_name' => 'slider-images', 'numberposts' => -1 );
$myposts = get_posts( $args );
foreach( $myposts as $post ){ setup_postdata($post);
?>
<li>
<?php the_post_thumbnail( 'full', array('alt' => 'Alt') ); ?>
<div class="slide-descr">
<?php the_content();?>
gulp.task('wiredep', function() {
var wiredep = require('wiredep').stream;
gulp.src('**/*.php')
.pipe(wiredep({
directory: 'bower_components'
}))
.pipe(replace(/(<script src=")(bower_components\/)/g, '$1<?php echo get_template_directory_uri(); ?>/$2'))
.pipe(gulp.dest(''));
});
* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
}
.wrapper {
display: flex;
@fobos98
fobos98 / get_first_post_in_category_with_locale
Last active April 13, 2017 13:01
Получить первый пост из категории, учитывая локаль
function first_post_in_cat ($cat) {
$args = array (
'category_name' => $cat,
'numberposts' => 1,
'meta_query' => array(
'relation' => 'AND', array(
'key' => '_locale',
'value' => get_locale(),
'compare' => '='
)
@fobos98
fobos98 / bg-change-hover-function.js
Created April 14, 2017 11:21
Изменение фона при наведении на айтемы
if ($(window).width() >= 992) {
$('.activities-item-1').hover(function () {
$(".activities-bg .img-1").siblings().animate({ opacity: '0' }, 500);
$(".activities-bg .img-1").animate({ opacity: '1' }, 500);
});
$('.activities-item-2').mouseenter(function () {
$(".activities-bg .img-2").siblings().animate({ opacity: '0' }, 500);
$(".activities-bg .img-2").animate({ opacity: '1' }, 500);
@fobos98
fobos98 / functions.php
Created April 14, 2017 12:36
Вывод постов из рубрики
function all_post_in_cat ($cat, $numberposts=-1, $order='ASC') {
$args = array (
'category_name' => $cat,
'numberposts' => $numberposts,
'meta_query' => array(
'relation' => 'AND', array(
'key' => '_locale',
'value' => get_locale(),
'compare' => '='
@fobos98
fobos98 / disable-map-scroll.js
Created April 14, 2017 14:25
map disable scroll on hover
$(document).ready(function($) {
var onMapMouseleaveHandler = function(event) {
var that = $(this);
that.on('click', onMapClickHandler);
that.off('mouseleave', onMapMouseleaveHandler);
that.find('iframe').css("pointer-events", "none");
};
var onMapClickHandler = function(event) {
var that = $(this);
<!-- Preloader -->
<div class="loaderArea">
<div class="loader"></div>
</div>
<style>
.loaderArea {
background: #fff;
overflow: hidden;
position: fixed;
left: 0;