The generate_before_comments hook appears inside the .comments-area element.
Usage
Please refer to the Using Hooks article to learn how to use this hook.
generate_archive_title
The generate_archive_title hook exists inside the archive.php file, and is used to insert the archive title.
Usage
Please refer to the Using Hooks article to learn how to use this hook.
Disallow PHP Execution
DISALLOW_FILE_EDIT is defined. Your should also disallow PHP execution in GP Hooks.
If you see this message, it means you have the following line in your wp-config.php file:
define( 'DISALLOW_FILE_EDIT', true );
If you didn』t add this code, it』s likely you』re using a security plugin which has added it for you.
This is recommended by WordPress as an extra layer of security. By disabling file editing, you prevent bad people who gain access to your Dashboard (bad in itself) from executing PHP and gaining access to your server.
GP Hooks also has a constant you can define to disallow PHP execution from within the hooks:
define( 'GENERATE_HOOKS_DISALLOW_PHP', true );
If DISALLOW_FILE_EDIT is defined, then you should disable PHP execution in GP Hooks. Likewise, if you disable PHP execution in GP Hooks, you should define DISALLOW_FILE_EDIT as well.
Where to add it
This constant should be added into your wp-config.php file, below the DISALLOW_FILE_EDIT constant.
Removing the admin message
If for some reason you want to keep PHP execution in GP Hooks (and disallow file editing), you can remove the admin message added by GP Premium with this function:
add_action( 'after_setup_theme', 'tu_remove_hooks_php_check' );
function tu_remove_hooks_php_check() {
remove_action( 'admin_notices','generate_hooks_php_check' );
}
Backgrounds Overview
To use this add-on, first make sure GP Premium is installed, and that the add-on is activated.
Once activated, you can find the Background options in Customize > Background Images.
Once the Background Images panel is open, you』ll see a list of sections for each element on your website.
Backgrounds panel
Each section has background options for the selected element.
Backgrounds section
Repeat
Choose to repeat the image, usually good for patterns or gradients.
Repeat – horizontally and vertically
Repeat x – horizontally
Repeat y – vertically
No repeat – don』t repeat
Size (Auto)
Size (Auto) – The background image contains its width and height
100% Width – The background image will be 100% wide, and the height will adjust to keep the aspect ratio
Cover – Scale the background image to be as large as possible so that the background area is completely covered by the background image.
Contain – Scale the image to the largest size such that both its width and its height can fit inside the content area
Attachment
Attachment – The background scrolls along with the element
Fixed – The background image is fixed and won』t move as you scroll
Local – The background scrolls along with the element』s contents
inherit – Inherits this property from its parent element
Position
Please refer to this article to understand the position field.
Secondary Menu Item Height & Width
Note: These options require the Secondary Navigation add-on in GP Premium.
We can adjust the width and height of our menu items, as well as the height of our sub-menu items in Customize > Layout > Secondary Navigation.
Width
This option adds the value to the left and right of your menu item item text. 20 = 20px on either side of your text.
Height
This value determines the height of your menu items. 60 = 60px tall.
Sub-Menu Item Height
This value determines the height of your sub-menu items. 10 = 10px on top and bottom of the text.
generate_typography_default_fonts
The generate_typography_default_fonts filter allows you to add font families to the system/default list in the Customizer.
Usage
Please refer to the Using Filters article to learn how to use this filter.
Example
add_filter( 'generate_typography_default_fonts','tu_add_system_fonts' );
function tu_add_system_fonts( $fonts ) {
$fonts[] = 'My Font Name';
return $fonts;
}
generate_category_post_navigation
The generate_category_post_navigation filter forces the post navigation on single posts to stay within its category instead of pointing to posts in other categories.
Default (boolean): false
Usage
Please refer to the Using Filters article to learn how to use this filter.
generate_after_entry_title
The generate_after_entry_title hook appears after the titles of your posts, including the archive and single post templates.
Usage
Please refer to the Using Hooks article to learn how to use this hook.
generate_leave_comment
The generate_leave_comment filter allows you to change the default Leave a Comment text.
Default (string): Leave a Comment
Usage
Please refer to the Using Filters article to learn how to use this filter.
Example
add_filter( 'generate_leave_comment','tu_custom_leave_comment' );
function tu_custom_leave_comment() {
return 'Join the conversation';
}
generate_before_copyright
The generate_before_copyright hook appears inside the .inside-site-info element within the footer.
Usage
Please refer to the Using Hooks article to learn how to use this hook.