Created
May 28, 2013 01:01
-
-
Save tnorthcutt/5659890 to your computer and use it in GitHub Desktop.
Short-circuit genesis_get_option to set Genesis options for a specific situation.
This file contains hidden or 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 | |
// These are just two examples | |
// Uses anonymous functions since these are for one-time use | |
// Short-circuit genesis_get_option to show thumbnails | |
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', function() { | |
return 1; // 1 shows thumbnails | |
} ); | |
// Short-circuit genesis_get_option to ensure we use 'thumbnail' for the thumbnail size | |
add_filter( 'genesis_pre_get_option_image_size', function() { | |
return 'thumbnail'; | |
}); | |
// Short-circuit genesis_get_option to ensure we use full width layout | |
add_filter( 'genesis_pre_get_option_site_layout', function() { | |
return 'full-width-content'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment