Skip to content

Instantly share code, notes, and snippets.

@kisildev
kisildev / functions.php
Created October 30, 2018 14:28
Polylang
//You must first register all these strings for translation.
//For example you echo "Hello world" in some template file like this:
<?php pll_e('Hello world'); ?>
//To show string in the "Strings translation" add in your functions.php:
add_action('init', function() {
pll_register_string('mytheme-hello', 'Hello world');
});
//Add all custom strings you want to translate to this function.
@kisildev
kisildev / main.scss
Created October 30, 2018 12:13
Composer slider
.wpb_images_carousel {
.vc_slide {
width: 100% !important;
position: static;
}
img {
width: 100%;
}
}
@kisildev
kisildev / index.php
Created October 12, 2018 12:14
Youtube video + overlay + play button
<?php if($rec_video = get_field('rec_video')): ?>
<div class="recruitment-video">
<div class="recruitment-video__item embed-box"><?php echo $rec_video; ?></div>
<?php if($video_pl = get_field('video_pl')): ?>
<div class="recruitment-video__overlay" <?php bg($video_pl, 'large'); ?>>
<div class="recruitment-video__play"></div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
@kisildev
kisildev / file.txt
Created October 11, 2018 09:01
Counter
https://github.com/bfintal/Counter-Up
@kisildev
kisildev / index.php
Created October 9, 2018 15:50
First post. Continue post.
<!-- Posts list -->
<section class="posts-section">
<div class="row">
<?php if (have_posts()) : ?>
<?php $i = 0; ?>
<?php while (have_posts()) : the_post(); ?>
<?php $i++; if($i == 1) {continue;} ?>
<div class="column"><?php the_title(); ?></div>
<?php endwhile; ?>
<?php endif; ?>
@kisildev
kisildev / file.txt
Created October 4, 2018 07:41
Google Recaptcha
https://www.google.com/recaptcha/admin
@kisildev
kisildev / main.js
Created October 2, 2018 10:17
Expanded image in content
// Expanded image in content
if ($('.single-page').length) {
$('p > img:only-child').parent().addClass('image-expanded');
}
@kisildev
kisildev / functions.php
Created October 1, 2018 12:01
wp_localize_scripts
// Stiky Header
$fixed_menu = get_field('fixed_menu', 'option') ? true : false;
wp_localize_script( 'global', 'menu', array( 'is_fixed' => $fixed_menu ) );
@kisildev
kisildev / custom.scss
Created September 24, 2018 16:22
Add quantity buttons (woccommerce)
// ******* CSS
.product-btn {
position: relative;
background-color: $gold;
color: $white;
border-radius: 25px;
text-transform: uppercase;
font-family: $sub_font;
margin: 20px auto;
overflow-y: hidden;
@kisildev
kisildev / index.php
Created September 19, 2018 07:50
Product category name (woocommerce)
<?php single_term_title(null, true); ?>