Centering Your Logo in the Mobile Header

Centering Your Logo in the Mobile Header

If you』re using the Mobile Header option along with a logo and search icon, you might want to change the layout a bit and place your mobile header logo in the center, and your mobile menu button on the left.
We can do this using a small snippet of CSS:
#mobile-header .site-logo {
position: absolute;
left: calc( 50% - 90px); /* 50% from the left - half your image width */
}

#mobile-header button.menu-toggle {
position: absolute;
left: 0;
}
The only part you need to tweak is the 90px. Adjust that value to exactly half the width of your mobile header logo.

Disable Secondary Navigation Mobile Menu

Disable Secondary Navigation Mobile Menu

Sometimes the secondary navigation only has a few links and doesn』t need to collapse into a mobile menu.
You can disable the mobile menu and only display the menu items with a function and a little CSS.
First, the function:
add_action( 'wp_enqueue_scripts', 'generate_dequeue_secondary_nav_mobile', 999 );
function generate_dequeue_secondary_nav_mobile() {
wp_dequeue_style( 'generate-secondary-nav-mobile' );
}
Learn how to add PHP here.
Then, the CSS:
.secondary-navigation .menu-toggle {
display: none;
}

@media(max-width: 768px) {
.secondary-navigation {
text-align: center !important;
}
.secondary-navigation ul {
display: block;
}
.secondary-navigation .sf-menu>li {
float: none;
display: inline-block !important;
}
}
Learn how to add CSS here.

Using Filters

Using Filters

GeneratePress uses the WordPress Filter API to add filters throughout the theme
Filters allow you to use a simple function to overwrite values, whether they』re options or even text on your site.
To view the available filters, please refer to the Filters collection.
Usage
add_filter( 'filter_name', 'example_function_name' );
function example_function_name()
{
return 'Your new value';
}

In the example above, replace filter_name with the name of the filter you』re wanting to use, like generate_404_title or generate_sidebar_layout.
Then replace example_function_name with a unique function name, something specific to you. My name is Tom Usborne, so I would prefix my function like this for example: tu_change_404_title
Learn how to add PHP here.

generate_404_title

generate_404_title

The generate_404_title filter allows you to change the default 404 title.
Default (string): Oops! That page can』t be found.
Usage
Please refer to the Using Filters article to learn how to use this filter.

generate_404_text

generate_404_text

The generate_404_text filter allows you to change the default 404 text.
Default (string): It looks like nothing was found at this location. Maybe try one of the links below or a search?
Usage
Please refer to the Using Filters article to learn how to use this filter.

generate_post_comment

generate_post_comment

The generate_post_comment filter allows you to change the default Post Comment text.
Default (string): Post Comment
Usage
Please refer to the Using Filters article to learn how to use this filter.

generate_search_label

generate_search_label

The generate_search_label filter allows you to change the default Search for: text.
Default (string): Search for:
Usage
Please refer to the Using Filters article to learn how to use this filter.

generate_search_placeholder

generate_search_placeholder

The generate_search_placeholder filter allows you to change the default Search … placeholder text.
Default (string): Search …
Usage
Please refer to the Using Filters article to learn how to use this filter.

generate_site_title_href

generate_site_title_href

The generate_site_title_href filter allows you to change the URL destination of your site title.
Default (string): Your URL set in Settings > General
Usage
Please refer to the Using Filters article to learn how to use this filter.

generate_fonts_subset

generate_fonts_subset

The generate_fonts_subset filter allows you to set a subset for your font if you』re using a language that requires it.
Default (string): No default
Here are some examples of subsets:
latin
latin-ext
menu
greek
greek-ext
cyrillic
cyrillic-ext
vietnamese
arabic
khmer
lao
tamil
bengali
hindi
korean
Usage
Please refer to the Using Filters article to learn how to use this filter.