This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use the built-in post counter | |
* | |
* Sometimes you'll want to keep track of which post you're on in a loop. | |
* Some people create their own $loop_counter (ex: Genesis, https://gist.github.com/4675237 ). | |
* There's a better way! A loop counter is built into $wp_query. Ex: | |
* | |
* global $wp_query; | |
* echo $wp_query->current_post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Featured Image on Single Posts | |
* | |
*/ | |
function be_single_featured_image() { | |
if( is_single() && has_post_thumbnail() ) | |
echo '<p class="featured-image">' . get_the_post_thumbnail( null, 'large' ) . '</p>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Grid Loop on Portfolio archive | |
* | |
* @author Bill Erickson | |
* @link https://github.com/billerickson/Genesis-Grid/wiki/Home | |
* | |
* @param bool $grid, whether to use grid loop | |
* @param object $query, the WP Query | |
* @return bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Our large image size | |
add_image_size( 'be_large', 500, 500, true ); | |
/** | |
* Genesis Grid - Use different image on CPT archive | |
* | |
* @author Bill Erickson | |
* @link http://wordpress.org/support/topic/filter-the-image-for-cpt-archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Limit homepage to one category | |
* | |
*/ | |
function be_home_query( $query ) { | |
if( $query->is_main_query() && $query->is_home() && !is_admin() ) | |
$query->set( 'category_name', 'sample-category' ); | |
} | |
add_action( 'pre_get_posts', 'be_home_query' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Auto-embeds Disabler | |
* Version: 0.1 | |
* Description: Disables the auto-embeds function in WordPress 3.5 | |
* Author: Dominik Schilling | |
* Author URI: http://wphelper.de/ | |
* Plugin URI: http://wpgrafie.de/1078/ | |
* | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Customize image size used in the loop by Genesis | |
* | |
* @author Jared Atchison | |
* @link http://jaredatchison.com/code/ | |
* @param string $image_size | |
* @global array $wp_query | |
* @global int $loop_counter | |
* @return string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Start the engine */ | |
require_once( get_template_directory() . '/lib/init.php' ); | |
/** Child theme (do not remove) */ | |
define( 'CHILD_THEME_NAME', 'Sample Child Theme' ); | |
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/genesis' ); | |
/** Add Viewport meta tag for mobile browsers */ | |
add_action( 'genesis_meta', 'add_viewport_meta_tag' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source: http://www.billerickson.net/customize-the-wordpress-query/#example-category | |
<?php | |
/** | |
* Exclude Post Formats from Blog | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/customize-the-wordpress-query/ | |
* @param object $query data | |
* |
NewerOlder