Skip to content

Instantly share code, notes, and snippets.

View bepatrickdavid's full-sized avatar

bepatrickdavid bepatrickdavid

View GitHub Profile
@bepatrickdavid
bepatrickdavid / gist:ca761c25bfc1216dfd9c
Created August 4, 2015 09:40
WP: Query get posts meta query acf
<?php $args = array(
'post_type' => 'documento',
'post_status' => 'publish',
'orderby'=> 'title',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'modulo',
'value' => '1',
'compare' => '=='
@bepatrickdavid
bepatrickdavid / gist:ee7fcb2786cec03e45b9
Created August 5, 2015 13:21
WP: register sidebar widget
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'Footer column 1',
'id' => 'footer-column-1',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
}
@bepatrickdavid
bepatrickdavid / maps.js
Last active August 31, 2015 09:06
GMAPS: mappa google maps con più marker con icone colorata
function initialize() {
var styles = [
{
stylers: [
{ hue: '#0a436d' },
{ visibility: 'simplified' },
{ gamma: 0.5 },
{ weight: 0.5 }
]
@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
@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 / 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 / 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 / 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:53ee0bb68fa8e324936d
Created September 4, 2015 14:25
JS: add remove class
$('#elm').click(function(){
$('#elm .elemento').toggleClass('active');
});
@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'] ?>