Skip to content

Instantly share code, notes, and snippets.

View AmeliaBriscoe's full-sized avatar

Amelia Briscoe AmeliaBriscoe

View GitHub Profile
@AmeliaBriscoe
AmeliaBriscoe / Thesis No Search Results
Created May 27, 2014 03:19
Display a zero results message in Thesis Classic Skin Search Template
function search_message() {
if (is_search()){
echo '<div class="no-results">';
echo '<h2>No items could be found for "'.get_search_query().'"</h2>';
echo '</div>';
}
}
add_action('thesis_empty_loop','search_message');
@AmeliaBriscoe
AmeliaBriscoe / Genesis CPT Archive Loop
Created May 27, 2014 03:21
Code displays taxonomy terms for a CPT in a Genesis archive template eg. archive-custom-post-type.php
add_action( 'genesis_after_content_sidebar_wrap', 'genesis_cpt_content' );
function genesis_cpt_content(){
if ( is_user_logged_in() ) {
/* Display the different taxonomy topics */
$taxonomy = 'genesis_content';
$terms = get_terms( $taxonomy, '' );
echo '<div class="course-dashboard">';
echo '<div class="row clearfix">';
echo '<div class="first one-half box course-list">';
@AmeliaBriscoe
AmeliaBriscoe / Genesis custom category template loop
Last active August 29, 2015 14:01
Custom Loop displayed in category template used in conjunction with Premise Membership Plugin
add_action( 'genesis_loop', 'genesis_category_content' );
function genesis_category_content(){
if ( is_user_logged_in() ) {
$category = get_category( get_query_var( 'cat' ) );
$args = array(
'cat' => $category->cat_ID,
'posts_per_page' => 12,
'paged' => get_query_var( 'paged' ),
'order' => 'ASC'
@AmeliaBriscoe
AmeliaBriscoe / category.php
Created January 10, 2015 02:53
Category template for Genesis with ho header, footer, sidebar etc
<?php
// Remove header, navigation, breadcrumbs, footer widgets, footer
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_do_header' );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
remove_action( 'genesis_after_header', 'genesis_do_nav' );
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs');
<?php
/**
* Adding all Asynchronous Javascripts to posts and pages
*/
function add_bulk_async_sdk() { ?>
<script>
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
add = function(url, id) {
@import url("../genesis/style.css");
/* =Theme customization starts here
-------------------------------------------------------------- */
@AmeliaBriscoe
AmeliaBriscoe / style.css
Last active August 29, 2015 14:16
Genesis Child Theme Style.css code
/*
Theme Name: Test Genesis Child Theme
Theme URI: http://www.yourdomainname.com
Description: This is a description for your child theme
Author: Wonder Woman
Author URI: http://www.yourdomainname.com
Version: 1.0
Tags:
Template: genesis
@AmeliaBriscoe
AmeliaBriscoe / functions.php
Created March 1, 2015 00:39
Genesis Child Theme Functions File Code
<?php
//* Load the Genesis core files
include_once( get_template_directory() . '/lib/init.php' );
//* Child theme Definitions
define( 'CHILD_THEME_NAME', __( 'Amelia Child Theme', 'genesiamelia' ) );
define( 'CHILD_THEME_URL', 'http://ameliabriscoe.com' );
define( 'CHILD_THEME_VERSION', '1.0' );
//* Add HTML5 markup structure
@AmeliaBriscoe
AmeliaBriscoe / style.css
Created March 1, 2015 00:48
Add Your Own Design Changes To Genesis
@import url("../genesis/style.css");
/* =Theme customization starts here
-------------------------------------------------------------- */
body{
background-color: #333333;
}
.site-header{
@AmeliaBriscoe
AmeliaBriscoe / button.html
Created April 12, 2015 23:05
CSS Code To Add A Button To Rainmaker Content
<!-- Add this code to the 'Text' tab of the content editing area. Replace the '/' with the URL you want to direct peope to -->
<p style="text-align: center;"><a href="/" class="button">Click Here</a></p>