Skip to content

Instantly share code, notes, and snippets.

View Lysindr's full-sized avatar

Alexey Lysindr

  • Ukraine
View GitHub Profile
<input class="hide" id="hd-1" type="checkbox" >
<label for="hd-1">Нажмите здесь, чтобы открыть!</label>
<div>Скрытое содержание......</div>
<input class="hide" id="hd-2" type="checkbox" >
<label for="hd-2">Нажмите здесь, чтобы прочитать больше!</label>
<div>Скрытое содержание...</div>
CSS
/*
@Lysindr
Lysindr / Hide element JqUery
Created August 3, 2016 20:01
Hide element
<span class="hider social-icon social-icon-default fa fa-arrow-circle-down"></span>
<div id="hidden" style="display:none">
<ul>
<li><a href="">Home</a></li>
<li><a href="">News</a></li>
<li><a href="">Post</a></li>
<li><a href="">Exit</a></li>
</ul>
@Lysindr
Lysindr / Mob menui
Created August 5, 2016 10:09
Mobile menu
SCSS
//////Desktop
.navmenu {
width: 382px;
font-family: $lato-regular;
text-transform: uppercase;
color: #fff;
& > ul {
display: flex;
@Lysindr
Lysindr / Flex pricing card.html
Created August 9, 2016 11:16
Flex pricing card
html//
<div class="pricing-grid">
<div class="plan plan1">
<h2>Title</h2>
<p>Some short description</p>
<ul class="features">
<li>Feature 1</li>
<li>Feature 2</li>
@Lysindr
Lysindr / flex-grid.html
Created August 9, 2016 11:17
Flex grid
<div class="grid">
<div class="grid__row">
<div class="grid__item">
<div class="item">
<p>Hello</p>
<a href="#">Click</a>
</div>
</div>
<div class="grid__item">
<div class="item">
@Lysindr
Lysindr / sticky-footer.html
Last active August 9, 2016 12:11
Sticky FOOTER with FLEX
@Lysindr
Lysindr / post.php
Last active September 20, 2016 14:04
Post slider
<div class="slider-wrapper">
<!-- Выводим посты из категории Technology в слайдер -->
<?php
$slide = array('category_name'=>'Business', 'posts_per_page'=>-1);
query_posts($slide);
while ( have_posts() ) : the_post();
?>
<div class="slide">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
@Lysindr
Lysindr / custom-menu.php
Created September 20, 2016 21:10
Custom Menu in WordPress
<nav class="main-menu">
<a href="#" class="menu-trigger">Menu</a>
<?php
wp_nav_menu( array(
'menu_class'=>'main-menu-list', //Класс, который будет навешан на ul
'container_class'=>'', //убераем класс контейнера, тк у нас уже есть <nav class="main-menu"></nav>
'theme_location'=>'top',
'after'=>'',
'container'=>'' // убераем контейнер для меню
) );
//1 Method - DONT WORK
<?php
$query = new WP_Query(array('category_name' => 'Technology', 'posts_per_page' => 1) ); //указываем имя категории рубрики, которые нужно вывести
if ( have_posts() ) : // если имеются записи в блогею
while ( $query -> have_posts() ) : $query->the_post(); // запускаем цикл перебора материала блога.
?>
<section class="technology-post">
<h5 class="category-name"><?php the_category(); ?></a></h5>
@Lysindr
Lysindr / functions.php
Created September 22, 2016 07:33
Popular posts #2
//----- Popular post-2
// DIY Popular Posts @ https://digwp.com/2016/03/diy-popular-posts/
function shapeSpace_popular_posts($post_id) {
$count_key = 'popular_posts';
$count = get_post_meta($post_id, $count_key, true);
if ($count == '') {
$count = 0;
delete_post_meta($post_id, $count_key);
add_post_meta($post_id, $count_key, '0');
} else {