Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
<?php
/* Template Name: Test */
/**
* Genesis custom loop
*/
function be_custom_loop() {
global $post;
// arguments, adjust as needed
@wpspeak
wpspeak / functions.php
Created June 16, 2013 22:07 — forked from billerickson/gist:2046751
Three column layout
<?php
/**
* Archive Post Class
* @since 1.0.0
*
* Breaks the posts into three columns
* @link http://www.billerickson.net/code/grid-loop-using-post-class
*
* @param array $classes
// Remove comments from posts
remove_action( 'genesis_after_post', 'genesis_get_comments_template' );
// Add comments back in if conditions are met
add_action( 'genesis_after_post', 'cd_conditional_comments' );
function cd_conditional_comments() {
// Conditional Reference http://codex.wordpress.org/Function_Reference/get_the_author
if ('Author Display Name' == get_the_author() ) {
genesis_get_comments_template();
@wpspeak
wpspeak / archive-testimonials.php
Created June 16, 2013 16:02 — forked from cdils/archive-testimonials.php
Create testimonial archive page
<?php
/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
@wpspeak
wpspeak / functions.php
Created June 14, 2013 22:10
Load Google Custom Fonts
<?php
//* Do NOT include the opening php tag
//* Load Lato and Merriweather Google fonts
add_action( 'wp_enqueue_scripts', 'custom_load_google_fonts' );
function custom_load_google_fonts() {
wp_enqueue_style( 'google-font', 'http://fonts.googleapis.com/css?family=Lato:300,400|Merriweather:300,400', array(), PARENT_THEME_VERSION );
}
@wpspeak
wpspeak / functions.php
Last active December 18, 2015 11:59 — forked from anonymous/functions.php
<?php
// Removee "Protected" and "Private" from Protected and Private Posts
function afn_title_trim($title) {
$title = attribute_escape($title);
$findthese = array(
'#Protected: #', // Notice the blank space after Protected:
'#Private: #' // Notice again, otherwise the title get pushed.
);