Skip to content

Instantly share code, notes, and snippets.

View JiveDig's full-sized avatar

Mike Hemberger JiveDig

View GitHub Profile
<div class="one-third first">
</div>
<div class="one-third">
</div>
<div class="one-third">
</div>
<div class="one-fourth first">
</div>
<div class="one-fourth">
</div>
<div class="one-fourth">
</div>
<div class="one-fourth">
<div class="one-fifth first">
</div>
<div class="one-fifth">
</div>
<div class="one-fifth">
</div>
<div class="one-fifth">
<div class="one-sixth first">
</div>
<div class="one-sixth">
</div>
<div class="one-sixth">
</div>
<div class="one-sixth">
// Add new image size
add_image_size( 'portfolio', 320, 200, true );
// Register Widget Area Above Footer
genesis_register_sidebar( array(
'id' => 'after_content_widget',
'name' => __( 'After Content Widget', 'themename' ),
'description' => __( 'This is a widget area that will be centered after the content', 'themename' ),
) );
// Add Widget Area Above Footer
add_action( 'genesis_after_content', 'after_content_widget' );
function after_content_widget() {
genesis_widget_area( 'after_content_widget', array(
@JiveDig
JiveDig / post_count_per_page.php
Last active December 17, 2015 05:19
Set the number of posts per page (post count). Must be in functions.php
// Set the number of posts per page
add_filter( 'pre_get_posts', 'be_archive_query' );
// @link http://www.billerickson.net/customize-the-wordpress-query/
function be_archive_query( $query ) {
if( $query->is_main_query() && $query->is_archive() ) {
$query->set( 'posts_per_page', 12 );
}
}
// OR
// ----------------------- Set the number of a custom post type posts per page
add_filter( 'pre_get_posts', 'be_archive_query' );
// @link http://www.billerickson.net/customize-the-wordpress-query/
function be_archive_query( $query ) {
if( $query->is_main_query() && $query->is_post_type_archive('code') ) {
$query->set( 'posts_per_page', 24 );
}
}
@JiveDig
JiveDig / gist:5558808
Created May 11, 2013 03:39
Embed a video using Advanced Custom Fields and url in text field.
/** Embeda video from url */
add_action( 'genesis_post_content', 'executive_do_video_single' );
function executive_do_video_single() {
$value = get_field( "video_url" );
if( $value ) {
echo '<p>';
echo wp_oembed_get ( $value );
echo '</p>';
}
}
// Remove post comments
add_action( 'wp_enqueue_scripts', 'custom_remove_comments' );
function custom_remove_comments() {
remove_action( 'genesis_after_post', 'genesis_get_comments_template' );
}