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
/** | |
* Automatically apply parent page template | |
* | |
* Inspired by: http://is.gd/wp_apply_parent_page_template | |
*/ | |
function fstop_use_parent_page_template() { | |
// Checks if current post type is a page, rather than a post | |
if ( is_page() ){ | |
$ancestors = get_post_ancestors( 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
/** | |
* Basic WordPredd comment style template | |
* | |
* ** Check your theme's comments templates & tags. _s theme uses .comment-list for the comment container, but yours may differ. | |
*/ | |
.comment-list{ | |
list-style:none; | |
margin:0 0 1em; | |
padding:0; |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
watch: { | |
css: { | |
files: '**/*.scss', | |
tasks: ['compass'], | |
}, | |
}, | |
compass: { // Task | |
dist: { // Target |
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 | |
// Numeric Page Navigation | |
function bones_page_navi() { | |
global $wp_query; | |
$bignum = 999999999; | |
if ( $wp_query->max_num_pages <= 1 ) | |
return; | |
echo '<nav class="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 | |
$args = array( | |
'post_type' => 'attachment', | |
'numberposts' => -1, | |
'post_status' => null, | |
'post_parent' => $post->ID | |
); | |
$attachments = get_posts( $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 | |
/* | |
* Password protect a WordPress site, with a redirect to the requested URL after successful login | |
* | |
* Based on: | |
* http://wordpress.stackexchange.com/a/64999 | |
* http://kovshenin.com/2012/current-url-in-wordpress/ | |
* | |
**/ |
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 | |
/* | |
* Basic WordPress Widget Code | |
* Save to: /wp-content/theme/widgets.php | |
* in functions.php or appropriate place: if ($wp_version >= 2.8) require_once(TEMPLATEPATH.'/widgets.php'); | |
* | |
*/ | |
class MyWidgetName extends WP_Widget | |
{ |
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 $images = get_field('gallery'); if( $images ): ?> | |
<ul class="thumb-grid"> | |
<?php foreach( $images as $image ): ?> | |
<li> | |
<a href="<?php echo $image['url']; ?>"> | |
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>"> | |
</a> | |
</li> | |
<?php endforeach; ?> | |
</ul> |