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 // Get rid of this tag | |
//* Register widget areas | |
genesis_register_sidebar( array( | |
'id' => 'after-entry', | |
'name' => __( 'After Entry', 'theme-prefix' ), | |
'description' => __( 'This is the after entry section.', 'theme-prefix' ), | |
) ); | |
//* Hooks after-entry widget area to single posts |
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 | |
//* Do NOT include the opening php tag | |
//* Add multiple grid loops to a page template*/ | |
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop | |
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop | |
function custom_do_grid_loop() { | |
$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
// add featured image to single posts | |
add_action ( 'genesis_entry_header', 'pbh_featured_image_title_singular' ); | |
function pbh_featured_image_title_singular() { | |
if ( !is_singular() || !has_post_thumbnail() ) | |
return; | |
echo '<div class="singular-thumbnail">'; | |
genesis_image( array( 'size' => 'medium' ) ); |
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 // Get rid of this tag | |
// Remove Post Info and Post Meta from Custom Post Types | |
function pbh_remove_post_info() { | |
if ( in_array(get_post_type(), array ('testimonial', 'project'))) { | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
} | |
} | |
add_action ( 'get_header', 'pbh_remove_post_info' ); |
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 // Get rid of this tag | |
// Remove Post Info, Post Meta from CPT | |
function pbh_remove_post_info() { | |
if( 'testimonial' == get_post_type() ) { | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
remove_action( 'genesis_entry_footer', 'genesis_post_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
<?php // get rid of this tag | |
// Filter the request to just give posts for the given taxonomy, if applicable. | |
function taxonomy_filter_restrict_manage_posts() { | |
global $typenow; | |
$post_types = get_post_types( array( '_builtin' => false ) ); | |
if ( in_array( $typenow, $post_types ) ) { | |
$filters = get_object_taxonomies( $typenow ); |
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 | |
// Note: Add only code below to your functions.php | |
// Add custom post types - cpt1 and cpt2 to main RSS feed. | |
function mycustomfeed_cpt_feed( $query ) { | |
if ( $query->is_feed() ) | |
$query->set( 'post_type', array( 'post', 'cpt1', 'cpt2' ) ); | |
return $query; | |
} | |
add_filter( 'pre_get_posts', 'mycustomfeed_cpt_feed' ); |
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
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2), | |
only screen and ( min--moz-device-pixel-ratio: 2), | |
only screen and ( -o-min-device-pixel-ratio: 2/1), | |
only screen and ( min-device-pixel-ratio: 2), | |
only screen and ( min-resolution: 192dpi), | |
only screen and ( min-resolution: 2dppx) { | |
.header-image .site-title > a { | |
float: left; | |
min-height: 133px; |
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 | |
$gallery = get_post_meta( get_the_ID(), 'home_slider'); // 'home_slider' is name of my ACF gallery field | |
$image_ids = $gallery[0]; // It's an array within an array | |
// If we have some images loop around and populate a new data array | |
if( is_array( $image_ids )) { | |
$image_ids_string = implode( ',', $image_ids ); // Soliloquy Dynamic requires image IDs to be passed as a comma separated list | |
echo '<div class="gallery-slider">'; | |
soliloquy_dynamic( array( | |
'id' => 'gallery-images', |
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
a span.screen-reader-text { | |
clip: rect(1px, 1px, 1px, 1px); | |
position: absolute !important; | |
height: 1px; | |
width: 1px; | |
overflow: hidden; | |
} |
OlderNewer