Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.