Skip to content

Instantly share code, notes, and snippets.

<?php
//* Enqueue scripts
add_action( 'wp_enqueue_scripts', 'minimum_front_page_enqueue_scripts' );
function minimum_front_page_enqueue_scripts() {
//* Load scripts only if custom background is being used
if ( ! get_background_image() )
return;
//* Enqueue Backstretch scripts
<?php
// Adding option to use featured image (if it exists)
// in place of background image
remove_action( 'genesis_after_header', 'beautiful_site_header_banner'); // removes existing banner image
add_image_size( 'featured-banner', 2000, 200, TRUE ); // creates a featured image size for the banner
function amcs_featured_img() {
<?php
//* Do NOT include the opening php tag
add_action( 'get_header', 'sk_posts_in_columns' );
function sk_posts_in_columns() {
if ( is_home() || is_archive() ) {
//* Display as columns
add_filter( 'post_class', 'sk_display_in_columns' );
@jamiemitchell
jamiemitchell / code.php
Last active August 29, 2015 14:19 — forked from srikat/code.php
<?php
//* Do NOT include the opening php tag
/**
* Get featured image markup.
*
* Only when the single Post or Page has a featured image, and only when
* showing the first page when the Page or Post is divided into multiple
* pages using next page quicktag.
*
remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );
<?php
/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a
* loop through a CPT archive
*/
/** Remove Post Info */
remove_action('genesis_before_post_content','genesis_post_info');
<?php
//* Do NOT include the opening php tag
// =================================================================
// = Pinterest-like Masonry layout for Posts page and Archives =
// =================================================================
//* Enqueue and initialize jQuery Masonry script
function sk_masonry_script() {
if (is_home() || is_archive()) {
add_action( 'pre_get_posts', 'sk_show_titles_only_category_pages' );
/**
* Show Linked Titles Only for Posts in Category Pages
*
* @author Sridhar Katakam
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/
<?php
/**
* Portfolio Archive
*
*/
/**
* Display as Columns
*
*/
/** Loop for Projects **/
$loop = new WP_Query( $args );
if( $loop->have_posts() ):
echo '<div id="container">';
while( $loop->have_posts() ): $loop->the_post();
echo '<div class="projects one-third '.genesis_get_custom_field('program') . ' ' .genesis_get_custom_field('project_type') . ' ' .genesis_get_custom_field('country') . '">';
echo '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
echo '<a href="' . get_permalink() . '">' . get_the_post_thumbnail( $post_id, 'project' ). '</a>';
echo '<h3 class="mmi-country ' . genesis_get_custom_field('country') . '">' . genesis_get_custom_field('country') . '</h3>';