I wouldn’t recommending any core files.
Instead, you can filter the title and make your changes, like so:
add_filter( 'document_title_parts', function( $title ) ) {
// $title is an array of parts
if ( strlen( $title['title'] ) > 10 ) {
$title['title'] = substr( $title['title'], 0, 5 ); // Show only first 5 characters
}
return $title;
}, 10, 1 );
Related Posts:
- When is it appropriate to put functions on page template vs. functions.php?
- When to check if a function exists
- Can I change header.php of current theme through a plugin function?
- Maximum lifetime for nonce
- Customise Grouped Product display in Woocommerce with custom column
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Add function to Dokan ajax class
- Dynamic banner for use on external sites
- Sticky bar with filter button and product count
- Clearing caches on plugin uninstall
- How to use a hook to override an update_post_meta call in a plugin?
- Add code inside specific wordpress standard function
- How to customize a permalink (URL) structure?
- Plugin: register custom post types, child ready and performance best practices
- Where can i find wordpress auto update code flows?
- Custom Taxonomy to dropdown box on adminside wordpress
- Create a free scripts and styles template within a plugin
- Edit Yoast SEO breadcrumbs output [closed]
- Adding option to Gallery shortcode
- correct way to call javascript into hook function
- How to modify the comments to be displayed in a post?
- Twentyten Child Theme: header images display messed up in admin panel
- How to change the hover content of a specific menu item on WordPress?
- How can I turn a custom wordpress page into a product page?
- how to search users by ajax live search
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Incorporate small angular feature in my wordpress site
- Remove unwanted elements for a wp_nav_menu
- How do I update a field of a meta box?
- How to Bind one post object Type with other postobject Type in Advanced Custom field [closed]
- How to add user details to different tables immediately after user registration
- Search: how to extend the existing search to include a custom table
- Is there documentation reference for forms in menu and setting pages?
- mysql_real_escape_string() vs. esc_sql() in WordPress
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- Checking for existence of a page by title?
- how to get context information inside my funcion
- Enqueue script globally
- How to make “upgrade safe” theme for a plugin?
- WordPress class, using add_action to call member function does not work
- Redirect to another page using contact form 7? [closed]
- How should I go about registering JavaScript that isn’t a file? [duplicate]
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- wp_get_post_terms Order by not working
- Update Data parameter of a wp_localize_script() call
- Custom entity search and display
- Function/Class to list categories with checkboxes
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- wp_get_theme Warning: Illegal offset type
- Plugin: database creation
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- Why wp_die() doesn’t work with wp_redirect but exit() works
- Warning: call_user_func_array() expects parameter 1 to be a valid callback
- Add Password Generator on password protected page
- Show message from backend
- Print Dashboard submenu name and filename
- Autogenerate a Table of Contents
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Why There Is No “get content by ID” Function
- Create Widget or Enable Shortcodes in Sidebar
- WordPress multisite,use same cookies across all website?
- Apply styles to blockquote element with the WYSIWYG editor
- Call to undefined function is_home() or any conditional tags
- unregister_setting() vs delete_option() for plugin update
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Randomizing wp_tag_cloud() in child theme
- Logout after clicking URL link results in “headers already sent” error
- Where do I go to edit this area? [closed]
- How to output functions from plugin inside theme
- how to save wp_editor html content in options table
- wp_schedule_event is registered but function isn’t running
- Converting core modification to a plugin
- How to use a WP_Customize_Control outside of the Customizer?
- Overwriting a plugin function
- Writing editor content to a file
- How to replace settings in WordPress plugin from a theme
- How to remove/replace current page template?
- Remove Permalink Meta Box not working?
- Adding tables to dashboard pages programmatically?
- Setting a post’s category
- Setting post_id for single.php based on URL without a redirect
- using admin functions on frontend
- Javascript Function Called Too Early in PHP Script
- Modify code for functions.php with specific twitter user url and hashtags
- Extract Information from post content (using regex?)
- can’t access some WordPress function from my plugin
- WP 3-way voting system: On to something! Please help!
- How to determine which capability to use?
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- Custom Settings Plugin Save foreach checkboxes
- Change the behaviour of a button
- How to keep plugin (media-sync) running even the tab is closed?
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Why won’t this submenu page show? – My First WordPress Plugin