Skip to content

Instantly share code, notes, and snippets.

View erezLieberman's full-sized avatar

Erez Lieberman erezLieberman

View GitHub Profile
@erezLieberman
erezLieberman / add wp shortcode code apper in place.php
Last active November 9, 2015 12:28
add wp shortcode code apper in place
<?php
function shortcode_function_name() {
ob_start();
// Code
...youre php/html code
$content = ob_get_clean();
return $content;
}
@erezLieberman
erezLieberman / short wp loop.php
Last active November 4, 2015 10:35
short loop
<?php
$args = array (
'posts_per_page' => '-1',
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();?>
<?php }
@erezLieberman
erezLieberman / acf repeater short syntax.php
Created November 3, 2015 09:18
acf repeater short syntax
<?php
if( have_rows('left_box_items') ): while ( have_rows('left_box_items') ) : the_row();?>
<?php the_sub_field('sub_field_name'); ?>
<?php endwhile;endif;?>
@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