Skip to content

Instantly share code, notes, and snippets.

@cjkoepke
cjkoepke / functions.php
Last active November 12, 2015 14:15
Custom Post Type Pagination Snippet
<?php
/**
*
* @author Calvin Koepke
* @link http://www.calvinkoepke.com/add-pagination-to-custom-post-types-in-genesis/
*
* Add previous and next buttons to custom post types.
*/
add_action('genesis_before_content', 'ck_custom_navigation_links', 5 )
function ck_custom_navigation_links() {
@cjkoepke
cjkoepke / functions.php
Created July 12, 2014 20:11
Modify User Profile Widget's Gravatar Size in Genesis Child Theme
<?php
/**
*
* Modify the size of the Gravatar in the User Profile Widget
*
* @author Calvin Koepke
* @since 1.0.0
*/
add_filter( 'genesis_gravatar_sizes', 'ck_user_profile' );
function ck_user_profile( $sizes ) {
@cjkoepke
cjkoepke / functions.php
Created July 22, 2014 19:19
Order Widgets
// Adding a 1 to the end of the action sets the priority of the function.
add_action( 'genesis_before_content_sidebar_wrap', 'ck_home_first_widget', 1 );
function ck_home_first_widget() {
genesis_widget_area( 'home-featured-post', array(
'before' => '<section>',
'after' => '</section>',
) );
}
// Add a 2 to the end to set the priority to second.
@cjkoepke
cjkoepke / style.css
Last active August 29, 2015 14:05
Jetpack Sharing CSS
/*
Jetpack Sharing
---------------------------------------------------------------------------------------------------- */
.sd-content ul li a.sd-button {
margin: 0 !important;
width: 25% !important; /* Whatever the number of icons you choose to be using, they should add up in percentages to EQUAL 100% (in this case, I used 4 icons, so 100/4 = 25%). */
border-radius: 0 !important;
text-align: center;
background: #39C9A8 !important; /* Main icon background color. */
@cjkoepke
cjkoepke / style.css
Last active August 29, 2015 14:05
CSS selector for styling author comments in the Genesis Framework.
/*
Style author comments using these Genesis Markup selectors.
Author: Calvin Koepke
Link: http://calvinkoepke.com/style-author-comments-correctly-genesis/
*/
.comment-list .children > .bypostauthor > article {
background: #fff;
border: 0;
border-right: 5px solid #39C9A8;
@cjkoepke
cjkoepke / style.css
Created February 19, 2015 18:08
The default header of a style.css file to designate a theme as a child theme.
/*
Theme Name: A Child Theme
Description: A demo child theme for the Calvin Makes seris: The Beginner's Guide to Building Your Own Website
Author: Calvin Makes
Theme URL: http://www.calvinmakes.com/build-your-first-genesis-child-theme/
Author URI: http://www.calvinmakes.com
Version: 1.0
License: GPL-2.0+
License URI: http://www.opensource.org/licenses/gpl-license.php
@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() {
@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 / 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 / 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 );