How to include a query_vars value in document_title_parts?

If your query var tags is registered properly then the following code snippet will definitely work, I’ve tested it. It’s a modified version of your code snippet. Please make sure to add the code to your functions.php file. function prefix_custom_title($title_parts) { global $wp_query; if (isset($wp_query->query_vars[‘tags’])) { $title_parts[‘title’] = $wp_query->query_vars[‘tags’]; } return $title_parts; } add_filter( ‘document_title_parts’, … Read more

Title tag come up differently on search results

I think that your title is too long. That’s why, Google has truncated it. However, if it’s not the case, try resubmitting your sitemap. Also, keep in mind that Google modifies the title according to what you’re looking for.

Site title not showing. Please help me

Use this code in Header.php file. <title><?php wp_title(‘ – ‘, true, ‘right’); ?></title> But as per page view source code.you have forgot to close tag above tag in header. so please close tag. see this screenshot Should code like this: <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag(‘js’, new Date()); </script> <title><?php wp_title(‘ – … Read more