Changing a page title while the page is being built
It seems that the way you attached your function to the document_title_parts filter is wrong. As per WordPress documentation, document_title_parts only accepts one parameters, array $title. So it doesn’t make sense that when you have 2 parameters in your function. I suggest you do something like this: function custom_document_title( $title_parts ) { // Here is … Read more