Skip to content

Instantly share code, notes, and snippets.

View franszo's full-sized avatar

Josh Francovszky franszo

View GitHub Profile
@franszo
franszo / owl-init.js
Last active September 12, 2015 12:45
Owl Carousel init based on data attributes JS init
// Carousels
$('.owl-carousel').each( function() {
var $carousel = $(this);
$carousel.owlCarousel({
dots : false,
items : $carousel.data("items"),
slideBy : $carousel.data("slideby"),
center : $carousel.data("center"),
loop : $carousel.data("loop"),
margin : $carousel.data("margin"),
@franszo
franszo / gist:238a0c75a59647773816
Last active August 29, 2015 14:19
Wordpress - Custom post type loop pagination
<?php
global $paged, $wp_query, $wp;
if ( empty($paged) ) {
if ( !empty( $_GET['paged'] ) ) {
$paged = $_GET['paged'];
} elseif ( !empty($wp->matched_query) && $args = wp_parse_args($wp->matched_query) ) {
if ( !empty( $args['paged'] ) ) {
$paged = $args['paged'];
}
}