Skip to content

Instantly share code, notes, and snippets.

@cjkoepke
cjkoepke / style.css
Last active November 5, 2015 17:02
Styling for a vertical navigation that is fixed and full-height. http://www.calvinkoepke.com/add-a-mobile-friendly-off-canvas-menu-in-genesis
/*
Title: How to Add a Mobile-Friendly, Off Canvas Menu in Genesis
Author: Calvin Koepke (@cjkoepke)
Link: http://www.calvinkoepke.com/add-a-mobile-friendly-off-canvas-menu-in-genesis
*/
/* Genesis Navigation Menu
--------------------------------------------- */
.genesis-nav-menu {
<?php
//* Do NOT include the opening PHP tag
/**
* Add the overlay div that will be used for clicking out of the active menu.
* @author Calvin Koepke (@cjkoepke)
* @link http://www.calvinkoepke.com/add-a-mobile-friendly-off-canvas-menu-in-genesis
*/
add_action( 'genesis_before', 'ck_site_overlay', 2 );
function ck_site_overlay() {
@cjkoepke
cjkoepke / functions.php
Last active November 5, 2015 13:50
Add a menu button to the Header, and a "Close Navigation" menu to the Primary Navigation for the off-canvas tutorial. http://www.calvinkoepke.com/add-a-mobile-friendly-off-canvas-menu-in-genesis/
<?php
//* Do NOT include the opening PHP tag
/**
* Add the menu to the .site-header, but hooking right before the genesis_header_markup_close action.
* @author Calvin Koepke (@cjkoepke)
* @link http://www.calvinkoepke.com/add-a-mobile-friendly-off-canvas-menu-in-genesis
*/
add_action( 'genesis_header', 'ck_menu_button', 14 );
function ck_menu_button() {
@cjkoepke
cjkoepke / functions.php
Last active November 5, 2015 13:51
Reposition the Primary Navigation to be right after the body tag. http://www.calvinkoepke.com/add-a-mobile-friendly-off-canvas-menu-in-genesis/
<?php
//* Do NOT include the opening PHP tag
/**
* Reposition the Primary navigation at the top of the DOM.
* @author Calvin Koepke
* @link http://www.calvinkoepke.com/add-a-mobile-friendly-off-canvas-menu-in-genesis
*/
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before', 'genesis_do_nav', 1 );
@cjkoepke
cjkoepke / footer-2-text-widget.html
Created March 21, 2015 19:11
The code used in the Text Widget in the Footer 2 Widget Area in the Church Pro Theme.
@cjkoepke
cjkoepke / home-top-text.html
Created March 21, 2015 15:59
The button code used on the Home Top Text Widget for the Church Pro Theme
<!--
DO NOT COPY THIS
The button code for the Home Top Text widget in Church Pro.
-->
<!-- COPY ONLY THE LINE BELOW -->
<a href="#" class="btn btn-white">Learn More About Us</a>
@cjkoepke
cjkoepke / search-placeholder.php
Created February 28, 2015 16:30
Modify the search placeholder text for the Genesis Framework
/**
* Modify the placeholder text of the default search form in Genesis.
* @author Calvin Makes
* @link http://www.calvinmakes.com/modify-placeholder-text-genesis-search-form/
*/
//* Return our new placeholder text (replace CHILD_THEME_TEXT_DOMAIN with your child theme slug).
add_filter( 'genesis_search_text', 'cm_search_placeholder' );
function cm_search_placeholder() {
return esc_attr__('New Placeholder Text', CHILD_THEME_TEXT_DOMAIN );
@cjkoepke
cjkoepke / style.css
Created February 26, 2015 15:54
Basic Styling from the Genesis Child Theme (preview snippet)
/* # Imports
---------------------------------------------------------------------------------------------------- */
@import url(//fonts.googleapis.com/css?family=Lato:300,400,700);
/* # HTML5 Reset
---------------------------------------------------------------------------------------------------- */
/* ## Baseline Normalize
--------------------------------------------- */
@cjkoepke
cjkoepke / style.css
Created February 19, 2015 18:37
Sample Theme Styles for the Genesis Framework
/* # Table of Contents
- Imports
- HTML5 Reset
- Baseline Normalize
- Box Sizing
- Float Clearing
- Defaults
- Typographical Elements
- Headings
- Objects
@cjkoepke
cjkoepke / Basic Genesis Settings in the Functions.php
Last active August 29, 2015 14:15
A basic setup of default Genesis child theme settings that are often used routinely.
<?php
//* Setup the Theme
//* =============================================================== */
//* Add the theme setup function below to the genesis_setup hook for better plugin compatability.
add_action( 'genesis_setup', 'cm_start_engine', 15 );
//* Define the theme settings and features in a function for use in the genesis_setup hook.
function cm_start_engine() {