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
<div class="site-inner"> | |
<div class="content-sidebar-wrap"> | |
<header class="entry-header"> | |
<h1 class="entry-title" itemprop="headline">Sample Page</h1> | |
</header> | |
<main class="content" id="genesis-content"> | |
<article class="post-31 page type-page status-publish entry" itemscope="" itemtype="http://schema.org/CreativeWork"> | |
<div class="entry-content" itemprop="text"> |
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 | |
/** | |
* This file adds the Custom Widget Page Template to ThemeCore. | |
* | |
* @author Brad Potter | |
* @package ThemeCore | |
* @subpackage Customizations | |
*/ | |
/* |
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 | |
/** | |
* This file adds the Custom Widget Page Template to ThemeCore. | |
* | |
* @author Brad Potter | |
* @package ThemeCore | |
* @subpackage Customizations | |
*/ | |
/* |
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
add_action('widgets_init', 'gpb_register_sidebar'); | |
/** | |
* Dynamically register sidebar for pages that use specified template | |
* | |
*/ | |
function gpb_register_sidebar() { | |
global $post; | |
global $wp_registered_sidebars; | |
// Find all pages that use template with dynamic sidebar |
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
add_filter( 'genesis_term_meta_defaults', 'add_term_meta_defaults' ); | |
function add_term_meta_defaults( $term_meta ) { | |
$more_term_meta = array( | |
'my_new_default' => '', | |
); | |
$term_meta = array_merge( $more_term_meta, $term_meta ); | |
return $term_meta; |
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
//* Modify the main query based on tag | |
add_action( 'pre_get_posts','custom_tax_query' ); | |
function custom_tax_query( $query ) { | |
if ( $query->is_main_query() && $query->is_tag( 'west-valley-2015' ) ) { | |
$query->set( 'posts_per_page', '3' ); | |
$query->set( 'order', 'ASC' ); | |
$query->set( 'orderby', 'title' ); | |
} | |
} |
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
add_filter( 'body_class', 'my_class_names' ); | |
function my_class_names( $classes ) { | |
global $post; | |
$layout = get_post_meta($post->ID, 'layout', true); | |
if ( is_singular() && $layout == 'sidebar-content' ) { | |
$classes[] = 'sidebar-content'; | |
} |
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
<body <?php | |
$layout = get_post_meta($post->ID, 'layout', true); | |
if ( is_singular() && $layout == 'sidebar-content' ) { | |
body_class( 'sidebar-content' ); | |
} | |
elseif ( is_singular() && $layout == 'full-width-content' ) { |
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
function my_custom_loop() { | |
$args = array( | |
'category_name' => 'featured', | |
'orderby' => 'post_date', | |
'order' => 'DESC', | |
'posts_per_page'=> '3', | |
); | |
$loop = new WP_Query( $args ); |
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#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |