This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// If needed to get a specific category | |
// echo "<pre>"; | |
// var_dump($wp_query->query_vars); | |
// echo "</pre>"; | |
// echo $wp_query->query_vars['gallery-category']; | |
$args = array( | |
'post_type' => 'gallery', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HCV | |
HTML - add data-attribute(clicked-node) to each photo with counter. | |
jQuery | |
// PhotoSwipe | |
$(".grid-item img").click(function(e) { | |
e = e || window.event; | |
e.preventDefault ? e.preventDefault() : e.returnValue = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a#footer-icon').click(function(e) { | |
e.preventDefault(); | |
var $t = $('#footer .bottom'); | |
if ($t.is(':visible')) { | |
$t.slideUp(400); | |
} else { | |
$t.slideDown(400); | |
$("html, body").animate({ scrollTop: $(document).height() }, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'special-offers-cpt', | |
'post_status' => 'publish', | |
'posts_per_page' => -1 | |
); | |
// The query | |
$child_query = new WP_Query($args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// http://fellowtuts.com/wordpress/bootstrap-3-pagination-in-wordpress/ | |
if (function_exists("wp_bs_pagination")) | |
{ | |
//wp_bs_pagination($the_query->max_num_pages); | |
wp_bs_pagination(); | |
} | |
?> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $query_string; | |
query_posts($query_string . "&post_type=document"); | |
?> | |
<?php if (have_posts()): while (have_posts()) : the_post(); ?> | |
<!-- article --> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$category = get_the_category(); | |
// echo $category[0]->category_parent; | |
$args = array( | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'posts_per_page' => 1, | |
'post__not_in' => array( get_the_ID() ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( window ).scroll(function() { | |
// if ($('body').not('.home').length > 0 ) { | |
if( $(window).scrollTop() > 0 ) { | |
$('#header').css('box-shadow', '0 1px 3px rgba(0, 0, 0, 0.5)'); | |
} else { | |
$('#header').css('box-shadow', 'none'); | |
} | |
// } | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Passing an object through JSON from PHP to JS, to use in PhotoSwipe.js | |
Allows different photo widths and heights in PhotoSwipe lightbox | |
See 'View image gallery' on littlewhitealice.co.uk/our-cottages/fearn-the-alder-house/ | |
---- HTML | |
$output .= "<div class='flexslider'> | |
<ul class='slides'>"; |