How to change the page title from functions.php
If you refer to the post title you need to hook your function to the_title filter like explained in the codex. add_filter(‘the_title’, ‘my_custom_title’, 10, 2); If you refer to the HTML meta in your page then you need to hook your function to document_title_parts filter explained here. add_filter(‘document_title_parts’, ‘my_custom_title’, 10, 2); The two filters work … Read more