Skip to content

Instantly share code, notes, and snippets.

View erezLieberman's full-sized avatar

Erez Lieberman erezLieberman

View GitHub Profile
@erezLieberman
erezLieberman / get url of featured image in wp.php
Created November 1, 2015 16:03
get url of featured image in wp
@erezLieberman
erezLieberman / stop and play youtube player inside bootstrap modal.js
Last active June 14, 2017 09:36
stop and play youtube player inside bootstrap modal
$('.hp_videos .modal').on('hidden.bs.modal', function (e) {
var url = $(this).find('iframe').attr('src');
$(this).find('iframe').attr('src',url);
console.log('close');
});
$('.hp_videos .modal').on('shown.bs.modal', function (e) {
var url = $(this).find('iframe').attr('src');
$(this).find('iframe').attr('src',url);
console.log('open');
});
@erezLieberman
erezLieberman / customize_Menufication_wp_plugin_css.scss
Last active August 29, 2015 14:27
customize Menufication wp plugin css
// change #F2F2F2 to your color and etc.
.page,.single,.archive{
#menufication-outer-wrap.light #menufication-top, #menufication-outer-wrap.light #menufication-non-css3-top, #menufication-non-css3-outer-wrap.light #menufication-top, #menufication-non-css3-outer-wrap.light #menufication-non-css3-top {
background-color: #fff !important;
background-image: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
height: 85px;
@erezLieberman
erezLieberman / gist:243653e90c78cd336a56
Last active April 29, 2016 22:28
custom icon in acf google maps
// create marker
var templateDir = "<?php bloginfo('stylesheet_directory') ?>";
var iconBase = templateDir + '/images/map_icon.svg';
var marker = new google.maps.Marker({
position : latlng,
map : map,
icon: iconBase
});
@erezLieberman
erezLieberman / Showed the opposite language ןin WPML language switcher
Last active August 29, 2015 14:23
Showed the opposite language ןin WPML language switcher
function my_custom_switcher( $items, $args ){
if( $args->theme_location == 'primary' ) {
$languages = icl_get_languages('skip_missing=0&orderby=code');
if(!empty($languages)){
ob_start(); ?>
@erezLieberman
erezLieberman / gist:76c6356b0f6aeea0799c
Created May 26, 2015 09:23
acf-options-page-with-wpml-support
http://www.duepi.biz/blog/2014/09/acf-options-page-with-wpml-support/
@erezLieberman
erezLieberman / gist:13e2f9adf593247a9a0b
Created May 21, 2015 13:31
Bootstrap 3 responsive columns of same height
http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-columns-of-same-height
<?php
$counter == 0;
// check if the repeater field has rows of data
if( have_rows('logos') ): ?>
<?php
// loop through the rows of data
<a class="share_twitter" href="https://twitter.com/home?status=<?php the_title();echo " - ". $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?> " target="_blank">
TWITTER
</a>
<a class="share_twitter" href="http://www.facebook.com/sharer/sharer.php?u=<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ?>&t=<?php the_title(); ?>" target="_blank">
FACEBOOK
</a>
@erezLieberman
erezLieberman / gist:a5c1c5e8743bd481aebc
Last active August 29, 2015 14:17
hover images inline from acf
<div class="icon" style="background-image:url(<?php the_sub_field('icon'); ?>)" onMouseOver="this.style.backgroundImage='url(<?php the_sub_field('hover_icon'); ?>)'" onMouseOut="this.style.backgroundImage='url(<?php the_sub_field('icon'); ?>)'"></div>
@erezLieberman
erezLieberman / if cf7 sent mail
Created February 25, 2015 21:29
if cf7 sent mail
$( document ).ajaxComplete(function( event,request, settings ) {
if($('.sent').length > 0){
console.log('good');
}else{
console.log('bad');
}
});