Skip to content

Instantly share code, notes, and snippets.

View erezLieberman's full-sized avatar

Erez Lieberman erezLieberman

View GitHub Profile
@erezLieberman
erezLieberman / gist:9228890
Last active May 2, 2016 01:05
youtube player from acf field
<?php if (get_field('youtubeURL')) {
$mystring = get_field('youtubeURL');
$parts = explode("=",$mystring);
$mystring = $parts['1']; ?>
<iframe width="440" height="228" src="//www.youtube-nocookie.com/embed/<?php echo $mystring ; ?>" frameborder="0" allowfullscreen></iframe>
<?php } ?>
@erezLieberman
erezLieberman / gist:9228947
Created February 26, 2014 12:50
//change style of div when hover on difrent div
//change style of div when hover on difrent div
$(function() {
$('.darkMask').hover(function() {
$(this).parent().find('.fa').addClass('off');
}, function() {
// on mouseout, reset the background colour
$(this).parent().find('.fa').removeClass('off');
});
});
@erezLieberman
erezLieberman / gist:9228963
Created February 26, 2014 12:52
stop you tube player when bootstrap 3 modal was hiden
//stop you tube player when bootstrap modal was hiden
$('.modal').on('hide.bs.modal', function () {
$(this).find('iframe').attr("src", $(this).find('iframe').attr("src"));
})
@erezLieberman
erezLieberman / gist:9231996
Created February 26, 2014 15:45
EXCLUDE CURRENT POST FROM WP QUERY
$currentID = get_the_ID();
$args = array (
'post__not_in' => array($currentID)
);
@erezLieberman
erezLieberman / gist:9255343
Last active August 29, 2015 13:56
Next/Previous Post Link Plus
//Next/Previous Post Link Plus marksup withe botstrapp 3
<div class="row postNav">
<div class="pull-right col-md-4 col-sm-4 col-xs-4" style="text-align:right">
<?php previous_post_link_plus(array('order_by' => 'post_title','loop' => true,'format' => '&laquo; %link','link' => 'פוסט הקודם') ); ?></div>
<div class="col-md-4 col-sm-4 col-xs-4" style="text-align:center"><a href="<?php echo get_permalink( 10 ); ?>">בחזרה לבלוג</a></div>
<div class="pull-left col-md-4 col-sm-4 col-xs-4" style="text-align:left">
<?php next_post_link_plus(array('order_by' => 'post_title','loop' => true,'format' => '%link &raquo;','link' => 'פוסט הבא') ); ?></div>
</div>
@erezLieberman
erezLieberman / gist:9306340
Created March 2, 2014 13:09
remove , from class
$(".isotopeCont .projectCont").each(function() {
value = $(this).attr("class").replace(",", "");
$(this).attr("class", value);
});
@erezLieberman
erezLieberman / gist:9600049
Last active August 29, 2015 13:57
check if is some browser in jquery
//if is safri
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)
{
//code here
}
//if is ie8
if ($.browser.msie && parseInt($.browser.version, 10) === 8) {
}
@erezLieberman
erezLieberman / gist:9616573
Created March 18, 2014 09:27
the url of the current child theme
<?php echo get_stylesheet_directory_uri(); ?>
@erezLieberman
erezLieberman / gist:9813398
Last active August 29, 2015 13:57
youtube player from acf field
<?php if (get_field('youtubeURL')) {
$mystring = get_field('youtubeURL');
$parts = explode("=",$mystring);
$mystring = $parts['1']; ?>
<div class="videoWrapper">
<iframe width="100%" height="450" src="//www.youtube-nocookie.com/embed/<?php echo $mystring ; ?>?html5=1" frameborder="0" allowfullscreen></iframe>
</div>
<?php } ?>
@erezLieberman
erezLieberman / gist:11188498
Created April 22, 2014 17:55
go to Top on click jquery
$(".gotoTop").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});