Header Presets

Header Presets

Header layout options for GP can be found in 「Appearance > Customize > Layout > Header」.

In starting in GeneratePress 2.2, the Header Presets options are added in the Customizer control to serve as a shortcut for specific header layouts.

generate_comment_form_title

generate_comment_form_title

The generate_comment_form_title filter allows you to change the default # thoughts on {post_title} text.

Default (string): # thoughts on {post_title}

Usage

Please refer to the Using Filters article to learn how to use this filter.

Example

add_filter( 'generate_comment_form_title', function() {
return 'What do others say';
} );

Adding a Logo/Header

Adding a Logo/Header

You can upload an image inside your header, typically referred to as a logo or header by going to 「Appearance > Customize > Site Identity」.

Then upload your header/logo using the Logo control.

If you have a regular logo uploaded, you』ll see an option to upload a retina logo. This method uses srcset to show your retina logo on screens that support it.

Starting in GeneratePress 2.2, you can also set the width of the logo using the slider.

You also have the option to add the site icon. Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps.

Changing the logo under specific conditions

In some cases, you might need to upload a different logo on a specific page/template. This option is built into our Page Header meta box, but can be changed using a filter as well.

For example, if we wanted a different logo on our About page, with about as our URL slug:

add_filter( 'generate_logo','tu_custom_about_logo' );
function tu_custom_about_logo( $logo )
{
// If we are on the about page, set our custom logo
if ( is_page( 'about' ) )
return 'URL TO OUR LOGO IN HERE';

// Or else, set the regular logo
return $logo;

}

You can use any of the available  WordPress conditionals to determine your sidebar layout.

Learn how to add PHP here.

Navigation Location

Navigation Location

The Navigation Location option can be found in Appearance > Customize > Layout > Primary Navigation. Prior to GP 1.3.42, it was named Navigation Position.

This option allows you to move your primary navigation to different areas on your website.

Each name is pretty self explanatory – simply select each option and you』ll see your navigation move instantly.

Of course, if you choose either of the sidebar options, that sidebar must be view-able on the page to see your navigation.

Navigation Drop point

One of the issues we see a lot is when the navigation is aligned right (or left), and the browser isn』t wide enough to fit the logo and navigation on one line.

To combat this, we』ve added a new option which allows you to specify a width at which point the navigation will drop down onto its own line and center.

Choosing your navigation location with a function

In some cases, you may need to change your navigation location a specific page, category etc..

There』s a filter available that allows you to do this:

add_filter( 'generate_navigation_location','tu_move_navigation' );
function tu_move_navigation( $location )
{
if ( is_front_page() ) {
return 'nav-float-right';
}

if ( is_archive() ) {
return 'nav-below-header';
}

return $location;
}

You can use any of the available  WordPress conditionals to determine which location your navigation will be moved to.

In the function above, I』m using  is_front_page() and is_archive() as examples.

These are the available IDs you can return:

nav-below-header
nav-above-header
nav-float-right
nav-float-left
nav-left-sidebar
nav-right-sidebar

If you want to remove the navigation from a page, simply return empty single quotes:

return '';

Learn how to add PHP here.

Uploading Translations

Uploading Translations

GeneratePress (theme)

The theme translations can be found over here on WordPress.org.

Once a translation reaches 95% approved, WordPress will ship it directly to your Dashboard within a few hours. Sometimes, you need to go to Dashboard > Updates in your Dashboard and click the Update Translations button.

If the translation isn』t over 95% approved and you want to add it anyways, you can download the file.

Click on your language name.Click on 「GeneratePress」

At the bottom, click Export. Doing so will download a file for you.

Make sure the file has this naming structure: generatepress-xx_XX where xx_XX is your language. For example, Spanish would be generatepress-es_ES.

Now access your WordPress site via FTP or File Manager, and navigate to wp-content/languages/themes and upload your file.

GP Premium (plugin)

GP Premium translations can be found here.

To download a translation, click on your language and click the Export link at the bottom.

This will download a file for you, which already has the correct filename.

Now access your WordPress site via FTP or File Manager and navigate to wp-content/languages/plugins and upload your file.

Generating Your Invoice

Generating Your Invoice

Once you purchase, you have the ability to generate your own invoice from inside your account.

First, login to your account here.

Then, click the Generate Invoice link in your Purchase History.

From there, you can fill out all of your required information and generate your invoice.

Conflicting Display Rules

Conflicting Display Rules

When we』re creating an Element, we always need to set Display Rules in order for them to apply on our live site.

If we』re adding a Hook or a Layout, these Display Rules won』t ever conflict, as we can have multiple hooks/layouts set to one condition without any issues.

However, we can only have one Page Hero per condition.

So what happens if we add multiple Page Heros, and apply them to the same condition?

When this happens, the older element (the one added first) will be applied to the condition, while the newer one will not show up.

So what if we want the newer one to show up?

In this case, we have two options:

a) Go into the older Element, and remove the condition you』re trying to apply to your new Element. This is ideal if it』s a specific condition (a specific page, etc..)

b) If the original condition is more broad (all pages, etc..), we can go into the older element and add the more specific condition we』re trying to set in the new Element within the Exclusions. This will exclude that specific condition from the older Element, freeing up the new Element to take its place.

So, if a Page Hero isn』t applying to one of your conditions, it means that condition is already occupied by a previous element.

Need an example?

Let』s say we added a Page Hero and applied it to all of our pages.

Now we added a new Page Hero and applied it to the About page, but this Page Hero doesn』t show up.

That』s because the first Page Hero is occupying that spot. So we need to go into our original Page Hero, and add the About page to the exclusions.