The option_generate_blog_settings
filter allows you to filter the options in our Blog add-on.
These options are all available in the customizer. The filters allow you to change the setting under certain conditions.
Available Options
Return Value
$options[‘read_more’]
Set the text of your read more link when excerpts are enabled.
'My custom read more label'
$options[‘read_more_button’]
Add button style to the read more label.
true false
$options[‘date’]
Show or remove the post date.
true false
$options[‘author’]
Show or remove the post author.
true false
$options[‘categories’]
Show or remove the post categories.
true false
$options[‘tags’]
Show or remove the post tags.
true false
$options[‘comments’]
Show or remove the link to the comments of the post.
true false
$options[‘infinite_scroll’]
Activate or disable infinite scroll feature.
true false
$options[‘infinite_scroll_button’]
Load posts automatically or manually with a load more button when infinite scroll is activated.
true false
$options[‘masonry_load_more’]
Set the text of the load more button when it’s activated.
'My custom load more text'
$options[‘masonry_loading’]
Set the text of the load more button when it’s activated.
'My custom loading text'
$options[‘post_image’]
Show or remove the featured images.
true false
$options[‘post_image_padding’]
Show or remove the padding around featured images.
true false
$options[‘post_image_position’]
Set the location of featured images.
'' //This would return Below Title 'post-image-above-header'
$options[‘post_image_alignment’]
Set the alignment of featured images.
'post-image-aligned-center' 'post-image-aligned-left' 'post-image-aligned-right'
$options[‘single_date’]
Show or remove the post date in single posts.
true false
$options[‘single_author’]
Show or remove the post author in single posts.
true false
$options[‘single_categories’]
Show or remove the post categories in single posts.
true false
$options[‘single_tags’]
Show or remove the post tags in single posts.
true false
$options[‘single_post_navigation’]
Show or remove the post navigations.
true false
$options[‘single_post_image’]
Show or remove the featured images in single posts.
true false
$options[‘single_post_image_padding’]
Show or remove the padding around featured images in single posts.
true false
$options[‘single_post_image_position’]
Set the location of featured images in single posts.
'below-title' 'inside-content' 'above-content'
$options[‘single_post_image_alignment’]
Set the alignment of featured images in single posts.
'center' 'left' 'right'
$options[‘page_post_image’]
Show or remove the featured images in static pages.
true false
$options[‘page_post_image_padding’]
Show or remove the padding around featured images in static pages.
true false
$options[‘page_post_image_position’]
Set the location of featured images in static pages.
'below-title' 'inside-content' 'above-content'
$options[‘page_post_image_alignment’]
Set the alignment of featured images in static pages.
'center' 'left' 'right'
$options[‘column_layout’]
Enable columns for posts.
true false
$options[‘featured_column’]
Enable the latest post to be featured.
true false
$options[‘masonry’]
Enable masonry grid with columns.
true false
Examples
If we want to use a different layout for search results pages:
add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' ); function lh_custom_search_results_page_settings( $options ) { if ( is_search() ) { $options['read_more_button'] = true; $options['date'] = false; $options['categories'] = false; $options['tags'] = false; $options['comments'] = false; $options['infinite_scroll'] = true; $options['infinite_scroll_button'] = true; $options['masonry_load_more'] = 'More search results'; $options['post_image'] = true; $options['post_image_position'] = 'post-image-above-header'; $options['post_image_alignment'] = 'post-image-aligned-center'; $options['column_layout'] = false; $options['featured_column'] = true; $options['masonry'] = false; } return $options; }
View full list of WordPress conditional tags.