Skip to content

Instantly share code, notes, and snippets.

View sxidsvit's full-sized avatar

Sergiy Antonyuk sxidsvit

View GitHub Profile
<?php
$images = getFieldOrder('img');
$i = 0;
foreach($images as $image) {
$i++;
$nuevos = array ("w" => 300, "h" => 200, "zc" => 1, "q" => 100);
$image_thumb = get_image('img', 1, $i, 0, NULL, $nuevos);
$image_link = get_image('img', 1, $i, 0, NULL); ?>
<?php echo $image_thumb; ?><br/>
<?php
wp_reset_query();
global $withcomments;
$withcomments = 1;
comments_template( '', true );
<!-- HTML -->
<a href="#" class="toggle-mnu hidden-lg"><span></span></a>
<!-- SASS -->
.toggle-mnu
display: block
width: 28px
height: 28px
margin-top: 14px
@sxidsvit
sxidsvit / mousewheel-icon.html
Created December 3, 2015 14:25
Mouse Wheel Animation CSS Icon | http://jsfiddle.net/cmajo9h6/
<style>
/* ---------------------------------------------- /*
* Mouse animate icon
/* ---------------------------------------------- */
.mouse-icon {
border: 2px solid #000;
border-radius: 16px;
height: 40px;
width: 24px;
display: block;
@sxidsvit
sxidsvit / gulpfile.js
Created December 7, 2015 18:25
gulpfile.js создан после прохождения трех уроков LoftSchool - Таски: 'default',['connect', 'html', 'css', 'watch', 'uncss'
"use-strict";
var gulp = require('gulp'),
concatCss = require('gulp-concat-css'),
connect = require('gulp-connect'),
livereload = require('gulp-livereload'),
minifyCss = require('gulp-minify-css'),
notify = require('gulp-notify'),
prefix = require('gulp-autoprefixer'),
rename = require('gulp-rename'),
@sxidsvit
sxidsvit / Smooth Scrolling
Last active December 18, 2015 23:45
Performs a smooth page scroll to an anchor on the same page. (https://css-tricks.com/snippets/jquery/smooth-scrolling/)
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
SASS:
.mfp-ready .mfp-figure
opacity: 0
.mfp-zoom-in
.mfp-figure, .mfp-iframe-holder .mfp-iframe-scaler
opacity: 0
transition: all 0.3s ease-out
transform: scale(0.95)
&.mfp-bg, .mfp-preloader
opacity: 0
How to use the plugin
$(".test-plugin").magnifierRentgen();</pre>
______________________________________________________
SASS:
.magnifierRentgen
box-sizing: border-box
overflow: hidden
position: relative
width: 100%
@sxidsvit
sxidsvit / theme-options.php
Created January 1, 2016 14:16
Шаблон для создания theme-options.php от А.Климанова
<?php
add_action( 'admin_init', 'theme_options_init' );
add_action( 'admin_menu', 'theme_options_add_page' );
/**
* Init plugin options to white list our options
*/
function theme_options_init(){
register_setting( 'sample_options', 'sample_theme_options', 'theme_options_validate' );
@sxidsvit
sxidsvit / get_category_by_slug_desc_tag.php
Last active January 1, 2016 20:14
Получим ID категории, передав функции её слаг
/*Получим ID категории, передав функции её слаг */
<?php $idObj = get_category_by_slug('s_about'); $id = $idObj->term_id; echo get_cat_name($id); ?>
/* Выводим описание категории */
<?php echo category_description($id); ?>
/* Выводим описание категории по тегу */
<?php
$tags = get_tags();
if ($tags) {