option_generate_woocommerce_settings

option_generate_woocommerce_settings

The option_generate_woocommerce_settings filter allows you to filter the options in our WooCommerce 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[『cart_menu_item』]
Adds a cart icon with the total price of your items in your primary navigation.

'true'
'false'

$options[『breadcrumbs』]
Display WC breadcrumbs.

'true'
'false'

$options[『columns』]
Set the number of columns to display your products on desktop.

'5' //Between 1-6

$options[『tablet_columns』]
Set the number of columns to display your products on tablet.

'4' //Between 1-4

$options[『mobile_columns』]
Set the number of columns to display your products on mobile.

'2' //Between 1-3

$options[『product_archive_image_alignment』]
Set the alignment of product image.

'left'
'center'
'right'

$options[『products_per_page』]
Choose how many products to display on each page.

'20'

$options[『product_archive_alignment』]
Set the alignment of product title.

'left'
'center'
'right'

$options[『shop_page_title』]
Display the 「Shop」 page title.

'true'
'false'

$options[『product_results_count』]
Display the results count.

'true'
'false'

$options[『product_sorting』]
Choose to sort the products or not.

'true'
'false'

$options[『product_archive_image』]
Display the product image.

'true'
'false'

$options[『product_secondary_image』]
Display the second product image when hover over the primary image.

'true'
'false'

$options[『product_archive_title』]
Display the product title.

'true'
'false'

$options[『product_archive_sale_flash』]
Display the product sales badge.

'true'
'false'

$options[『product_archive_sale_flash_overlay』]
Display the sale flash on top of the image or under product title.

'true'
'false'

$options[『product_archive_rating』]
Display the product ratings.

'true'
'false'

$options[『product_archive_price』]
Display the product price.

'true'
'false'

$options[『product_archive_add_to_cart』]
Display the add to cart button.

'true'
'false'

$options[『product_archive_description』]
Display the short description below the product title.

'true'
'false'

$options[『product_tabs』]
Display tabs which hold the item description, reviews, specs etc..

'true'
'false'

$options[『product_related』]
Display products related to the currently viewed item.

'true'
'false'

$options[『product_upsells』]
Display upsells products.

'true'
'false'

$options[『related_upsell_columns』]
Choose how many columns to show our related/upsell products on desktop.

'3' //Between 1-6

$options[『mobile_related_upsell_columns』]
Choose how many columns to show our related/upsell products on mobile.

'3' //Between 1-3

$options[『product_meta』]
Display meta for the current product (category, SKU etc..)

'true'
'false'

$options[『product_description』]
Display short description below the product title.

'true'
'false'

Example
If we want to use columns for a certain category:
add_filter( 'option_generate_woocommerce_settings','lh_custom_category_wc_columns' );
function lh_custom_category_wc_columns( $options ) {
if ( is_product_category( 'CATEGORY-HERE' ) ) {
$options['columns'] = 2;
}

return $options;
}

option_generate_settings

option_generate_settings

The option_generate_settings filter allows you to filter the options in our free theme.
These options are all available in the customizer. The filters allow you to change the setting under certain conditions.

Available Options

Return Value

$options[『hide_title』]
Remove site title.

'true'
'false'

$options[『hide_tagline』]
Hide site tagline.

'true'
'false'

$options[『container_width』]
Set the container width

'1200' //from 700 to 2000 in increment of 5

$options[『top_bar_width』]
Set the outer width of top bar.

'full'
'contained'

$options[『top_bar_inner_width』]
Set the inner width of top bar.

'full'
'contained'

$options[『top_bar_alignment』]
Set the alignment of top bar.

'left'
'center'
'right'

$options[『header_layout_setting』]
Set the outer width of header.

'fluid-header' //full
'contained-header' //contained

$options[『header_inner_width』]
Set the inner width of header.

'contained' //contained
'full-width' //full

$options[『header_alignment_setting』]
Set the alignment of header.

'left'
'center'
'right'

$options[『nav_layout_setting』]
Set the outer width of primary navigation.

'fluid-nav' //full
'contained-nav' //contained

$options[『nav_inner_width』]
Set the inner width of primary navigation.

'contained' //contained
'full-width' //full

$options[『nav_alignment_setting』]
Set the alignment of primary navigation.

'left'
'center'
'right'

$options[『nav_position_setting』]
Set the position of primary navigation.

'nav-below-header'
'nav-above-header'
'nav-float-right'
'nav-float-left'
'nav-left-sidebar'
'nav-right-sidebar'
''//no navigation

$options[『nav_dropdown_type』]
Set the how the dropdown menu is initiated.

'hover'
'click'
'click-arrow'

$options[『nav_search』]
Activate or disable navigation search

'enable'
'disable'

$options[『content_layout_setting』]
Choose to use separate container or one container

'separate-containers'
'one-container'

$options[『footer_layout_setting』]
Set the outer width of footer.

'fluid-footer'
'contained-footer'

$options[『footer_inner_width』]
Set the inner width of footer.

'contained'
'full-width'

$options[『footer_bar_alignment』]
Set the alignment of footer.

'left'
'center'
'right'

$options[『back_to_top』]
Activate or disable the back to top button.

'enable'
'' //disable

$options[『post_content』]
Choose to show full post or excerpt.

'full'
'excerpt'

Example
If we want to use different settings for single posts:
add_filter( 'option_generate_settings','lh_single_posts_settings' );
function lh_single_posts_settings( $options ) {
if ( is_single() ) {
$options['nav_position_setting'] = 'nav-above-header';
$options['nav_alignment_setting'] = 'center';
}

return $options;
}

option_generate_secondary_nav_settings

option_generate_secondary_nav_settings

The option_generate_secondary_nav_settings filter allows you to filter the options in our Secondary Nav 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[『secondary_nav_mobile_label』]
Set the text of your secondary mobile menu label.

'My custom secondary mobile menu label'

$options[『secondary_nav_layout_setting』]
Set the outer container width of secondary navigation.

'secondary-fluid-nav' //full
'secondary-contained-nav' //contained

$options[『secondary_nav_inner_width』]
Set the inner container width of secondary navigation.

'full-width' //full
'contained' //contained

$options[『secondary_nav_alignment』]
Set the alignment of secondary navigation.

'left'
'center'
'right'

$options[『secondary_nav_position_setting』]
Set the position of secondary navigation.

'secondary-nav-below-header'
'secondary-nav-above-header'
'secondary-nav-float-right'
'secondary-nav-float-left'
'secondary-nav-left-sidebar'
'secondary-nav-right-sidebar'
''//no navigation

$options[『merge_top_bar』]
Merge secondary navigation with top bar widget area when it』s set to above header

'true'
'false'

Example
If we want to use different settings for single posts:
add_filter( 'option_generate_secondary_nav_settings','lh_single_posts_secondary_nav_settings' );
function lh_single_posts_secondary_nav_settings( $options ) {
if ( is_single() ) {
$options['secondary_nav_position_setting'] = 'secondary-nav-above-header';
$options['secondary_nav_alignment'] = 'center';
}

return $options;
}

option_generate_blog_settings

option_generate_blog_settings

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.

Blog Content Layout

Blog Content Layout

Note: These options require the Blog add-on in GP Premium.
Starting in GP Premium 1.5, the blog content layout options are separated for Archives (blog index, categories, archives and tag pages) and Single (single posts) by using the toggle button.
You can also use the option_generate_blog_settings filter to set the settings under other conditions.
Archives

Content Type – Choose whether your blog/archives display the full content of the posts, or the excerpts.
Excerpt word count – Set the length of excerpts. To hide excerpts, set the length to 0.
Read more label – Set the text of your read more link when excerpts are set. To remove read more label, simply leave the field blank.
Display read more as button – Add button style to the read more label. The color and typography can be modified in the customizer.
Display post date – Show or remove the post date.
Display post author – Show or remove the post author.
Display post categories – Show or remove the post categories.
Display post tags – Show or remove the post tags.
Display comment count – Show or remove the link to the comments of the post.
Use infinite scroll – Activate or disable infinite scroll feature.
Use button to load more posts – Choose to load posts automatically or manually with a load more button when infinite scroll is activated.
Load more label – Set the text of the load more button when it』s activated.
Loading label – Set the text that appears while new posts are loading.

Single

Display post date – Show or remove the post date.
Display post author – Show or remove the post author.
Display post categories – Show or remove the post categories.
Display post tags – Show or remove the post tags.
Display post navigation – Show or remove the post navigations.

excerpt_length

excerpt_length

The excerpt_length filter allows you to set the length of the excerpt.
Examples
If you want remove excerpt on category pages:
add_filter( 'excerpt_length','lh_custom_category_excerpt_length', 1000 );
function lh_custom_category_excerpt_length( $length )
{
if ( is_category() ) {
return 0;
}
return $length;
}
Usage
Please refer to the Using Filters article to learn how to use this filter.

generate_page_header_id

generate_page_header_id

The generate_page_header_id allows you to change the Page Header ID based on selected conditions.
So you can write your conditionals to select a certain post or set of posts, and change the ID to a specific Page Header.
Usage
For example, if we want assign a page header to author pages:
add_filter( 'generate_page_header_id', function( $id ) {
if ( is_author() ) {
return 17686; // ID of the Page Header to use.
}

return $id;
} );
or assign a page header to date archives:
add_filter( 'generate_page_header_id', function( $id ) {
if ( is_archive() ) {
return 17686; // ID of the Page Header to use.
}

return $id;
} );

Off Canvas Panel Overview

Off Canvas Panel Overview

Note: This option requires the Menu Plus add-on in GP Premium.

Starting in GP Premium 1.8, the former Slideout Navigation panel is replaced by the off canvas panel.

First, make sure there is a menu assigned to Off Canvas Menu under menu settings

You can choose to activate your off canvas panel on mobile, desktop, both or disable it completely.

Style

Slide – This is the typical slideout navigation. You can also choose the side it slides out and where the close button is positioned.

Overlay – This is the full-screen overlay style off canvas panel that has been increasingly popular nowadays. When activated, you can choose Set Overlay Defaults and let GP style it for you. These settings can also be changed in Colors > Off Canvas Panel and Typography > Off Canvas Panel.

Menu Item Height

Set the menu item height for the off canvas panel.

Off Canvas Panel Widget Area

The off canvas panel has a widget area, which you can add widgets to in Appearance > Widgets or Customize > Widgets.

You can simply use for widgets, and leave out the navigation completely if you like!

Use Off Canvas Menu Only

Some users wish to use off canvas menu only on desktop. This can be done with the simple method below:

First, create a menu with the desired items and assign it to Off Canvas Menu in theme locations.

Then create an empty menu and assign it to Primary Menu in theme locations

Then you can head to navigation location to adjust the position of the toggle.

Empty Off Canvas Navigation

If you have activated the off canvas navigation but the menu items aren』t showing up:

Then make sure you have a menu assigned to off canvas menu in Theme Location.