Skip to content

Instantly share code, notes, and snippets.

View ckschmieder's full-sized avatar

Chris Schmieder ckschmieder

View GitHub Profile
.fa-heartbeat:before {
top: 1px;
position: relative;
}
// add to existing a and i elements
#main .new-button a {
transition: all .3s ease-in;
}
@ckschmieder
ckschmieder / customloop.php
Created August 24, 2016 15:17
Want to loop thu PAGES with the category slug 'behavior'
<?php
global $post;
$my_query_args = array(
'posts_per_page' => 0, // change this to any number or '0' for all
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => 'behavior',
'post_type' => 'page'
<?php
/**
*
*
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package AAFP
*/
@ckschmieder
ckschmieder / page.php
Created August 27, 2016 15:26
Calling in custom image field that is setup to require user to crop image to set aspect ratio. Replaced Featured Image.
<?php
$image = get_field('top_image');
$link = get_field('link', $image['ID']);
?>
<figure class="featured-image">
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
</figure>
@ckschmieder
ckschmieder / ancestors-image.php
Created October 6, 2016 15:42
Need this to work with my custom image field in stead of the_post_thumbnail
<?php
global $post;
$parents = get_post_ancestors( $post->ID );
/* Get the ID of the 'top most' Page if not return current page ID */
$id = ($parents) ? $parents[count($parents)-1]: $post->ID;
$image = get_field('top_image');
if( $image( $id )) {
the_post_thumbnail( $id, 'thumbnail');
}
<?php
/**
* The template for displaying all single posts.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package AAFP
*/
get_header(); ?>
<?php
/**
* Template part for displaying posts.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package AAFP
*/
?>
@ckschmieder
ckschmieder / index.php
Created December 17, 2016 20:49
untouched index template from verko theme
<?php get_header(); ?>
<div id="content-wrap" class="df_container-fluid fluid-width fluid-max col-full">
<div class="df_row-fluid main-sidebar-container">
<?php df_isotope_category_blog(); ?>
<div <?php dahz_attr('content'); ?>>
@ckschmieder
ckschmieder / gist:0e3d7e2f70b08773c28c3ad5b508e813
Created January 27, 2017 15:50
functions.php (error on line 139?)
<?php
if(!function_exists('dynamo_file')) {
/**
*
* Function used to get the file absolute path - useful when child theme is used
@ckschmieder
ckschmieder / polaroidmob-test.js
Created February 15, 2017 06:49
Test code for mob nav improvement
$(".site-header a.category-link").click(function(){
$("p").removeClass("expanded");
});
$(".site-header a.homeAnchor").click(function(e){
e.preventDefault();