Skip to content

Instantly share code, notes, and snippets.

@kisildev
kisildev / events-1.php
Last active February 25, 2019 10:41
Upcoming events
<!-- Get upcoming events -->
<div class="columns medium-6 align-right">
<?php $events_args = array(
'post_type' => 'contest',
'meta_key' => 'contest_year_ch',
'orderby' => 'meta_value',
'posts_per_page' => -1
);
$upcoming_events = new WP_Query( $events_args );
@kisildev
kisildev / main.js
Created February 19, 2019 16:07
algorithm
// var c = floor(5 / 2) = 2
// 5 + c
// ___________________
// [0] [1] {2} [3] [4] [5] [6] {7} {8} [9] [10]
// ___________________ ____________________
// 0 + c 6 + c
// var c = floor(3 / 2) = 1
@kisildev
kisildev / functions.php
Created February 17, 2019 10:56
ACF Google Map
<?php
// Load scripts and styles
function add_scripts_and_styles() {
if ( ! is_admin() ) {
// For styles
wp_enqueue_style( 'main-style', get_template_directory_uri() . '/style.css', null, null );
// For scripts (js)
wp_enqueue_script('jquery');
wp_enqueue_script( 'main-js', get_template_directory_uri() . '/js/main.js', null, null, true );
// Map
@kisildev
kisildev / style.css
Created December 26, 2018 17:18
Pre last of type
:nth-last-of-type(2) {
}
@kisildev
kisildev / main.scss
Created December 17, 2018 17:02
Sass self
// General person styles
.person {
$s: &;
position: relative;
margin-bottom: 30px;
&__first-part {
text-align: center;
}
@kisildev
kisildev / last.php
Last active December 10, 2018 17:06
resources
<?php
/**
* Home
*
* Standard loop for the blog-page
*/
get_header(); ?>
<div class="media">
@kisildev
kisildev / mixins.scss
Last active May 15, 2019 16:14
Mixins
@mixin min($width) {
@media ( min-width: $width) {
@content;
}
}
@mixin max($width) {
@media ( max-width: $width) {
@content;
}
@kisildev
kisildev / main.js
Created November 28, 2018 12:03
Content toggler
function boxToggler(trigger, toggleBox) {
$(trigger).on('click', function(event) {
event.preventDefault();
var target = event.target;
if ($(target).parent().has(toggleBox)) {
var toggleElem = $(target).parent().find(toggleBox)[0];
$(toggleElem).fadeToggle();
}
});
}
@kisildev
kisildev / style.scss
Created October 31, 2018 14:31
Media
@mixin median($width) {
@media ( min-width: $width) {
@content;
}
}
@mixin mediax($width) {
@media ( max-width: $width) {
@content;
}
@kisildev
kisildev / info.txt
Created October 31, 2018 10:04
Business Catalyst post migration
Step 1: Create RSS chanel - https://www.screencast.com/t/JhXHaJ1vZ7h
Step 2: Find and select your posts - https://www.screencast.com/t/Rrpli4ywD
Step 3: Install "Import XML feed" plugin in WP - https://www.screencast.com/t/aEGhhLpG
Step 4: Get RSS link in Business Catalyst - https://www.screencast.com/t/pLgcsXacz
Step 5: Copy RSS link from href attribute - https://www.screencast.com/t/ASotR7lt
Step 6: Open "Import XML feed" plugin in WP and paste the link - https://www.screencast.com/t/d0zJEm5YuA
Step 7: Select a place for imported posts and tune your potion - https://www.screencast.com/t/G9PEKv8NTLFC
Last Step: Rejoice!