Skip to content

Instantly share code, notes, and snippets.

View erezLieberman's full-sized avatar

Erez Lieberman erezLieberman

View GitHub Profile
@erezLieberman
erezLieberman / gist:11249141
Last active August 29, 2015 14:00
wp list page from current parent page
<?php
$parentPage = $post->post_parent;
$parentPageTitleId = get_post($parentPage);
$parentPageTitle = $parentPageTitleId->post_title;
$args = array(
'child_of' => $parentPage,
'title_li' => $parentPageTitle
);
@erezLieberman
erezLieberman / gist:11368092
Last active August 29, 2015 14:00
FAQ tmplt with bootstrap3 and ACF
<div class="panel-group" id="accordion">
<?php
$counter = 1;
// check if the repeater field has rows of data
if( have_rows('faqs') ):
// loop through the rows of data
while ( have_rows('faqs') ) : the_row(); ?>
<div class="panel panel-default">
@erezLieberman
erezLieberman / gist:11368553
Created April 28, 2014 11:05
Bootstrap 3 accordion styling on open/closed
//Bootstrap 3 accordion styling on open/closed
$('.panel').on('show.bs.collapse', function () {
$(this).addClass('active');
});
$('.panel').on('hide.bs.collapse', function () {
$(this).removeClass('active');
});
@erezLieberman
erezLieberman / gist:11378802
Last active August 29, 2015 14:00
image from acf to theme
<?php
$image = get_sub_field('clientLogoImage');
if( !empty($image) ):
// vars
$url = $image['url'];
$title = $image['title'];
$alt = $image['alt'];
@erezLieberman
erezLieberman / gist:c7980d5e80a1bb6187f9
Created April 30, 2014 17:11
//remove the dot if there is just one image from royal slider
$( window ).load( function(){
//remove the dot if there is just one image from royal slider
var n = $( ".rsBullet" ).length;
if(n < 2){
$( ".rsBullets" ).remove();
}
//end of window.load function
@erezLieberman
erezLieberman / gist:f38f633d537b45bf1496
Last active August 29, 2015 14:01
//change the apperence of mobile menu button
.rtl{
#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: #f2efef !important;
background-image: none !important;
}
#menufication-nav li.menufication-active-class>a, #menufication-non-css3-nav li.menufication-active-class>a {
color: #81b735!important;
}
ul.menufication-menu-level-0{
@erezLieberman
erezLieberman / gist:92f4402f009659d34820
Created May 11, 2014 09:56
remove the admin_bar in wp
//remove the admin_bar
add_filter ('show_admin_bar','__return_false');
@erezLieberman
erezLieberman / gist:7c0c889138690ded917a
Last active August 29, 2015 14:01
on resize function
$( window ).resize(function() {
//some code - function();
});
<?php if ( have_posts()) : while (have_posts()) : the_post(); ?>
<!-- loop code here -->
<?php endwhile; else: ?>
<!-- code if there isn't content here -->
<?php endif; ?>
@erezLieberman
erezLieberman / functions.php
Last active August 29, 2015 14:01
add script.js to wp theme
<?php
//include js to theme
function theme_js(){
global $wp_scripts;
wp_enqueue_script( 'script_js' , get_stylesheet_directory_uri().'/js/script.js', array('jquery') ,'' , true );
}