Skip to content

Instantly share code, notes, and snippets.

@lilumi
lilumi / loop-two-col2.php
Last active January 3, 2016 13:49
Вивід постів в дві колонки 1 4 2 5 3 6
<?php
$i = 0;
if ( have_posts() ) : while ( have_posts() ) : the_post();
if ($i == 0) echo '<div class="onleft">';
if ($i == (round($wp_query->post_count / 2))) echo '</div><div class="onright">';
the_title();
the_content();
if ($i == $wp_query->post_count) echo '</div>';
$i++;
endwhile; endif;
@lilumi
lilumi / loop-two-col.php
Created January 17, 2014 11:50
Вивід постів в дві колонки 1 2 3 4 5 6
<?php if (have_posts()) : $i=1; ?>
<div class="wrap-box">
<?php while (have_posts()) : the_post(); ?>
<div class="half-box<?php if ($i%2 == 0) echo ' even'; ?>">
<h3><?php the_title(); ?></h3>
<?php the_content(); ?>
</div>
<?php $i++; endwhile; ?>
</div>
<?php endif;?>
@lilumi
lilumi / functions.php
Last active February 16, 2017 16:19
Збірна солянка функцій для теми вордпресу
<?php
add_editor_style();
// post thumbnail support
add_theme_support( 'post-thumbnails' );
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
remove_action('wp_head', 'next_post_rel_link', 10, 0);
remove_action('wp_head', 'feed_links', 2);
@lilumi
lilumi / onResize.js
Last active December 27, 2015 04:19
функція, що викликаєтсья після завершення ресайзу
var waitForFinalEvent = (function () {
var timers = {};
return function (callback, ms, uniqueId) {
if (!uniqueId) {
uniqueId = "Don't call this twice without a uniqueId";
}
if (timers[uniqueId]) {
clearTimeout(timers[uniqueId]);
}
timers[uniqueId] = setTimeout(callback, ms);