Skip to content

Instantly share code, notes, and snippets.

@tnorthcutt
Created May 28, 2013 01:01
Show Gist options
  • Save tnorthcutt/5659890 to your computer and use it in GitHub Desktop.
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.
<?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