Skip to content

Instantly share code, notes, and snippets.

@chillybin
chillybin / chillybin-style.css
Last active March 29, 2019 00:07
ChillyBin Child Theme - Common Styles
body {
font-family: 'system-ui', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}
/* Full Width Page
-------------------------------------------- */
.site-inner.full {
max-width: none;
padding: 0;
$("footer.infinite a").click(function(e){
loadArticle();
e.preventDefault();
});
function loadArticle() {
$("footer.infinite a").html("...");
var offset = $("footer.infinite a").data("count");
var num = parseInt(offset, 10);
var cat = $("footer.infinite a").data('cat');
@chillybin
chillybin / scripts.js
Created October 22, 2018 07:51
Ajax Load More
$("a.load-more").click(function(e){
loadArticle();
e.preventDefault();
});
function loadArticle() {
$("footer.infinite a").html("...");
var offset = $("a.load-more").data("count");
var num = parseInt(offset, 10);
var cat = $("a.load-more").data('cat');
@chillybin
chillybin / functions.php
Last active August 22, 2018 15:48
Emulating the Squarespace Mobile Menu Bar
<?php
add_action('genesis_after', 'cb_mobile_bar', 999);
function cb_mobile_bar() { ?>
<div class="mobile-bar">
<div class="mobile-bar-triggers">
<div class="mobile-bar-trigger" data-type="contactEmail">
<a href="mailto:[email protected]">
<span class="mobile-bar-trigger-icon"></span>
<span class="mobile-bar-trigger-label">Email</span>
</a>
@chillybin
chillybin / functions.php
Created October 5, 2017 01:22
TRW Footer
<?php
//* Customise footer
remove_action( 'genesis_footer', 'genesis_do_footer', 10 );
add_action( 'genesis_footer', 'trw_do_footer', 8 );
function trw_do_footer() { ?>
<div class="footer-credits">
<div class="row copyright">
<div class="col-xs-12 col-md-6 center-xs text-xs-center start-md text-ms-left">
<p>&copy; <? echo date( 'Y' ); ?> The Recovering Workaholic, All Rights Reserved.</p>
</div>
@chillybin
chillybin / countdown.php
Created October 27, 2016 13:06
Simple PHP Date Countdown
<div class="home-section promo">
<div class="wrap">
<div class="row gutter-40 middle-xs">
<div class="col col-xs-12 col-sm-4 widget rwc-countdown">
<div class="row bottom-xs-10 center-xs">
<div class="col cd-head col-xs-12">
<h4>20 SEPTEMBER - 2 NOVEMBER 2019</h4>
</div>
</div>
<div class="row cd-date gutter-5 bottom-xs-10 center-xs">
@chillybin
chillybin / functions.php
Created September 6, 2016 00:00
IMC Healthcare Page Title w Breadcrumbs
<?
//* Remove Page Title
add_action( 'get_header', 'remove_titles_all_single_pages' );
function remove_titles_all_single_pages() {
if ( is_singular('page') ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
} if (is_singular('post')) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
@chillybin
chillybin / functions.php
Created November 17, 2015 01:04
Add Advertisement after 1st post in Genesis
add_action('genesis_after_post', 'ad_after_first_post');
function ad_after_first_post() {
global $wp_query;
if( !is_singular && 0 == $wp_query->current_post ) { ?>
<div id='div-gpt-ad-1442795039305-2'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1442795039305-2'); });
</script>
</div>
<?php }
@chillybin
chillybin / functions.php
Created November 16, 2015 03:57
For this example to work you will need to install Advanced Custom Fields, create a text field called "youtube_video_id" and then when you are creating your post, you can embed your video, and then use the ID from YouTube into the text box.
add_action('wp_head', 'chillybin_custom_og_image');
function chillybin_custom_og_image() {
if (get_field('youtube_video_id')) { ?>
<meta property="og:image" content="http://img.youtube.com/vi/<? echo get_field('youtube_video_id'); ?>/mqdefault.jpg" />
<?php }
}
@chillybin
chillybin / functions.php
Last active August 29, 2015 14:26
Advertisement after Entry Title, before Entry Content
<?php
add_action( 'genesis_entry_header', 'cb_advertisement_before_content', 20 );
function cb_advertisement_before_content() { ?>
<div class="entry-advertisement alignleft">
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=300×250&w=300&h=250" alt="Please replace me" width="300" height="250" />
</div>
<?php }