Skip to content

Instantly share code, notes, and snippets.

View bepatrickdavid's full-sized avatar

bepatrickdavid bepatrickdavid

View GitHub Profile
@bepatrickdavid
bepatrickdavid / script.js
Created October 13, 2015 08:47
Magnific Popup: img link and a link
$('.one-slide').each(function() { // the containers for all your galleries
$(this).magnificPopup({
delegate: 'a', // the selector for gallery item
type: 'image',
gallery: {
enabled:true
}
});
});
@bepatrickdavid
bepatrickdavid / gist:14fcbc4651b020f28173
Created September 28, 2015 10:54
jQUERY: click every x second
var interval = null;
jQuery(function(){
interval = setInterval(callFunc, 5000);
});
function callFunc(){
jQuery('.slick-next').trigger('click');
}
@bepatrickdavid
bepatrickdavid / gist:0c5432b1b3b362913d71
Last active September 28, 2015 10:15
WP: htaccess redirect reindirizzamento page in base languages in base alla lingua
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Language} ^en [NC]
RewriteRule ^/?$ http://www.zendergroup.com/en/ [R,NC,L]
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule ^/?$ http://www.zendergroup.com/de/ [R,NC,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
@bepatrickdavid
bepatrickdavid / gist:edd71381f325c314b6ee
Created September 24, 2015 09:30
ACF: get extension file
<?php $myfile = get_field('file', $fi->ID) ?>
<?php $file_url = $file[url] ?>
<?php $path_parts = pathinfo($file_url); ?>
<?php $extension = $path_parts['extension'] ?>
@bepatrickdavid
bepatrickdavid / gist:53ee0bb68fa8e324936d
Created September 4, 2015 14:25
JS: add remove class
$('#elm').click(function(){
$('#elm .elemento').toggleClass('active');
});
@bepatrickdavid
bepatrickdavid / gist:ab5e0f4d1156e9f2ec7c
Created September 3, 2015 15:21
WP: unire due get post merge
<?php if($connected): ?>
<?php $result = array_merge( $connected, $documentazioni ); ?>
<?php else: ?>
<?php $result = $documentazioni ?>
<?php endif; ?>
@bepatrickdavid
bepatrickdavid / gist:8f67621b7a01f999216a
Created August 28, 2015 15:08
ACF: get post order by date picker
<?php $news = get_posts(array(
'post_type' => 'post',
'post_status' => 'publish',
'meta_key' => 'data_evento', //nome custom field
'orderby' => 'meta_value_num',
'order' => 'DESC',
'posts_per_page' => 12,
'cat' => '3'
)); ?>
@bepatrickdavid
bepatrickdavid / style.css
Created August 25, 2015 13:10
Bootstrap: dropdown menu on hover apertura menu
.dropdown-menu .sub-menu {
left: 100%;
position: absolute;
top: 0;
visibility: hidden;
margin-top: -1px;
}
.dropdown-menu li:hover .sub-menu {
visibility: visible;
@bepatrickdavid
bepatrickdavid / functions.php
Created August 24, 2015 10:17
WP: inglobare script style file stylesheet javascript
function theme_name_scripts() {
wp_enqueue_style( 'font-awesome', get_template_directory_uri() .'/font-awesome/css/font-awesome.min.css' );
wp_enqueue_style( 'owl.carousel.css', get_template_directory_uri() .'/owl-carousel/owl.carousel.css' );
wp_enqueue_style( 'owl.theme.css', get_template_directory_uri() .'/owl-carousel/owl.theme.css' );
wp_enqueue_style( 'custom-style', get_template_directory_uri() .'/style.css' );
wp_enqueue_script( 'owl-carousel', get_template_directory_uri() .'/owl-carousel/jquery-1.9.1.min.js' );
wp_enqueue_script( 'owl.carousel', get_template_directory_uri() .'/owl-carousel/owl.carousel.js' );
wp_enqueue_script( 'filterable', get_template_directory_uri() .'/js/filterable.js' );
}
@bepatrickdavid
bepatrickdavid / gist:db700b9b4b7d789b6885
Created August 24, 2015 08:30
Google Maps: google maps non signed non pulsante login
<!-- Google Maps -->
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=false"></script>
signed_in=false