The generate_meta_viewport filter allows you to change the viewport meta tag.
Default (string):
Usage
Please refer to the Using Filters article to learn how to use this filter.
Author 詩語
Updating GeneratePress
GeneratePress is the free theme that acts as the framework to your website.
To check what version you』re using, you can go to Appearance > GeneratePress.
From time to time, updates will be released for it and you should update your site to most recent version.
To do this, go to Appearance > Themes and click the Update Now link.
Updating GeneratePress
To learn how to update GP Premium, click here.
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_inside_secondary_navigation
The generate_inside_secondary_navigation hook appears inside the .inside-navigation element within your Secondary Navigation.
Usage
Please refer to the Using Hooks article to learn how to use this hook.
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.
Disable Mobile Responsive Features
Your site being mobile responsive is important to your overall experience to your user, and how Google ranks you in their search.
However, if you need to disable the mobile responsive features, you can use this plugin.
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.
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.
Removing Comments
WordPress used to enable comments on all pages by default, but thankfully that』s not the case anymore.
However, they are enabled on posts by default, and might still be enabled on your current pages depending on when you installed WordPress.
1. To stop future pages or posts you add from having comments, go to Settings > Discussion and de-select the couple options at the top dealing with comments and trackbacks. Note that this will only affect future pages, you will still have to do #2 below.
2. To remove comments from existing pages, go to the 「Pages」 area in your Dashboard (or whatever post type you have), and click 「Quick Edit」 within the pages you wish to remove the comments from. While in Quick Edit mode, you』ll see an option to allow comments which you can de-select.
It』s important to note that if your page or post already has comments, disabling them like the above will simply stop new comments from being added. Existing comments and pingbacks will still display. If you wish to remove them, you』ll need to delete the actual comments or pingbacks from your installation in the 「Comments」 area of your Dashboard.
If you wish to disable comments on certain post types but not others (not have them on pages, but do have them on posts), this plugin is great: Disable Comments
generate_show_tags
The generate_show_tags filter allows you to choose whether to display your tag links or not.
Default (boolean): true
Usage
Please refer to the Using Filters article to learn how to use this filter.