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;
}

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;
} );

Footer Widths

Footer Widths

Footer layout options can be found in Customize > Layout > Footer.
Footer Width
The Footer Width option is the outer container of your footer, including your footer widgets and copyright area.
Setting this to Full will make your background color/image span the entire width of your screen.
Setting it to Contained will contain it to the width of your container, set in Customize > Container.
Inner Footer Width
The Inner Footer Width option refers to the inner container which holds the content of your footer (Footer widgets, copyright area).
Setting this to Full will make your footer content span the entire width of your screen.
Setting it to Contained will contain your footer content to the width of your container.

generate_show_post_navigation

generate_show_post_navigation

The generate_show_post_navigation allows you to remove the individual post navigation shown at the bottom of your single posts.
Default (bool): true
Usage
Please refer to the Using Filters article to learn how to use this filter.

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_show_title

generate_show_title

The generate_show_title filter allows you to choose whether to display your page titles or not.
To remove titles globally, use this snippet:
add_action( 'after_setup_theme', 'tu_remove_all_titles' );
function tu_remove_all_titles() {
add_filter( 'generate_show_title', '__return_false' );
}
Default (boolean): true
Usage
Please refer to the Using Filters article to learn how to use this filter.

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.

Site Submission Terms

Site Submission Terms

You must agree to all of the following in order to have your Sites packaged in GP Premium.

Sites should be useful to the user without having to install the packaged content. This means that GeneratePress itself should be customized to a specific point of being useful to the user. For example, Sites that only make use of page builder templates with minimal GeneratePress elements will be rejected.
Sites must be customizable inside the Customizer. Custom CSS that overwrites Customizer options should be limited, especially when it comes to colors and typography.
Site content must not include any affiliate links whatsoever.
Site content must not include any tracking scripts, including Google Analytics or any other service.
Site content must not include any malicious coding intended to harm the user. If malicious coding is found, the site will be rejected, and any other existing Sites from the same submitter will be removed.
All content and images must be GPL licensed. You will need to include URLs to the images you』ve packaged in your Site.
GeneratePress and GP Premium are GPL, so any sites you submit will also fall under the GPL license.
Sites can be removed or disabled at any time without notice.