WordPress: Getting Title Tag In PHP Variable
I am using Yoast SEO for SEO on the website. In my header file I have added
<title><?php wp_title( '|', true, 'right' ); ?></title>
I have also added
<?php wp_head(); ?> in header.
Also enabled Force rewrite titles but still the title tag which I have added in page while editing it, in SEO Snippet is not displaying on webpage.
I have not added support for
add_theme_support( 'title-tag' ); - Adding it and removing title tag from head also won't make any difference
So my question here is how I can grab the title tag Added in snippet and at list echo it out in page. On API for Yoast they have listed some hooks and filters but their are no examples.
Can get it by
Make sure to add
add_theme_support( 'title-tag' ); in functions.php and remove any
<title></title> tags from header.php
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?