Getting pre_get_document_title to work
-
I have a dynamic page, and I’m trying to update the page title to match the content. I’m trying to use
pre_get_document_title
, but I can’t seem to get the filter to work.I’ve removed
<title>
fromheader.php
, and I have test code infunctions.php
:add_filter("after_setup_theme", function(){ add_theme_support("title-tag"); }); add_filter("pre_get_document_title", function($title){ error_log('test'); return "test"; });
The error log works, but the title remains <page name> – <site name>.
Any advice? Thanks!
- The topic ‘Getting pre_get_document_title to work’ is closed to new replies.