Skip to content

Instantly share code, notes, and snippets.

@VlaDeveloper
VlaDeveloper / common.js
Last active July 6, 2021 08:24
toggle mobile menu
$('.toggle-mnu').on('click', function() {
$('.hidden-mnu').slideToggle(function(){
if($(this).css('display') == 'none'){
$(this).removeAttr('style');
}
});
});
@VlaDeveloper
VlaDeveloper / Video hack
Last active March 16, 2019 12:05
Super video hack
html:
<div class="video-relation">
<div class="video-relation-ration"></div>
<iframe class="video-relation-content" src="https://www.youtube.com/embed/By_Cn5ixYLg" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
sass:
.video-relation
position: relative
&-content
width: 100%
@VlaDeveloper
VlaDeveloper / news.php
Created March 7, 2019 14:26
wp get posts
<?php
// параметры по умолчанию
$posts = get_posts( array(
'numberposts' => -1,
'orderby' => 'date',
'order' => 'ASC',
'post_type' => 'news',
'suppress_filters' => true,
// подавление работы фильтров изменения SQL запроса
) );
@VlaDeveloper
VlaDeveloper / about.php
Created March 4, 2019 16:52
get posts by taxonomy
<?php
$term = get_term_by('name', 'Достижения', 'info');
$id = $term->term_id;
// параметры по умолчанию
$posts = get_posts( array(
'numberposts' => -1,
'orderby' => 'date',
'order' => 'ASC',
'post_type' => 'about-items',
'suppress_filters' => true,
[[getImageList?
&tvname=`some-item`
&tpl=`some-item`
&docid=`1`]]
@VlaDeveloper
VlaDeveloper / common.js
Created February 9, 2019 09:03
img svg to inline
$("img.img-svg").each(function(){var t=$(this),r=t.attr("id"),a=t.attr("class"),e=t.attr("src");$.get(e,function(e){var i=$(e).find("svg");void 0!==r&&(i=i.attr("id",r)),void 0!==a&&(i=i.attr("class",a+" replaced-svg")),!(i=i.removeAttr("xmlns:a")).attr("viewBox")&&i.attr("height")&&i.attr("width")&&i.attr("viewBox","0 0 "+i.attr("height")+" "+i.attr("width")),t.replaceWith(i)},"xml")});
@VlaDeveloper
VlaDeveloper / _vars.sass
Created February 9, 2019 08:34
main transition
@mixin mt($t)
transition: all $t ease
@VlaDeveloper
VlaDeveloper / button.sass
Last active June 11, 2021 11:12 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
@VlaDeveloper
VlaDeveloper / migx-sample.js
Created December 9, 2018 09:34 — forked from agragregra/migx-sample.js
MIGX Sample
Tabs:
[
{"caption":"Tab Title", "fields": [
{"field":"title","caption":"Name"},
{"field":"description","caption":"Description","inputTVtype":"textarea"},
{"field":"imageTV","caption":"Photo","inputTV":"imageTV"}
]}
]
Table:
@VlaDeveloper
VlaDeveloper / index.php
Last active November 16, 2018 14:02
show extra posts
<?php foreach(getContacts() as $contact): ?>
<div class="contact_item">
<div class="contact_item_title"><i class="fa fa-<?php echo $contact['icon']; ?>"></i> <?php echo $contact['title']; ?></div>
<div class="contact_item_content"><?php echo $contact['content']; ?></div>
</div>
<?php endforeach; ?>