Skip to content

Instantly share code, notes, and snippets.

View erezLieberman's full-sized avatar

Erez Lieberman erezLieberman

View GitHub Profile
<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');
}
});
@erezLieberman
erezLieberman / gist:61b75b79fb51da94efcb
Created February 24, 2015 11:38
wp the_excerpt() by charcters
<?php echo substr(get_the_excerpt(), 0,30); ?>
//disable the submit btn when input field empty
$('input.search-field').mousemove(function() {
var empty = false;
$('.search-field').each(function() {
if ($(this).val().length == 0) {
empty = true;
}
});
@erezLieberman
erezLieberman / svg_acf_image.php
Created December 16, 2014 10:58
allow svg in acf image field
<?php $image = get_sub_field('features_img');
if( !empty($image) ):
// vars
$url = $image['url'];
$title = $image['title'];
$alt = $image['alt'];
$caption = $image['caption'];
@erezLieberman
erezLieberman / theme.js
Last active August 29, 2015 14:10
theme.js
(function($) {
$(document).ready(function(){
alert("wow it's work!!!");
//end of document).ready function
});
$( window ).load( function(){
//end of window.load function
@erezLieberman
erezLieberman / gist:f2ac621fefbac7219abd
Last active August 21, 2017 15:09
embed video to wp acf
<div class="videoWrapper">
<!-- from here: http://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php -->
<?php if( get_field('youtube_url') ){
$embed_code = wp_oembed_get( get_field('youtube_url') );
echo $embed_code;
} ?>
</div>
@erezLieberman
erezLieberman / child-theme.js
Last active December 1, 2015 13:54
child theme - starting point
(function($) {
$(document).ready(function(){
alert("wow it's work!!!");
// view the entire object of PHP variables
console.dir(ourPhpVariables);
// retrieve the site name from the object
var siteName = ourPhpVariables.siteName;
@erezLieberman
erezLieberman / coolSass.scss
Created June 13, 2014 09:52
Cool SASS Mixins & Functions
//Sassy Z-Index Management For Complex Layouts
$elements: project-covers, sorting-bar, modals, navigation;
.project-cover {
z-index: index($elements, project-covers);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */