I'm having issues with the website's meta information. If I set the default meta information, it will display the same information tag for all the pages.
But when I'm trying to set the meta info for a specific page then the Meta title and description do not display.
I have set the Meta description & title for one category. In this case, the Meta description & title tag showing for the same category page.
Solution I applied to display both the tags for category pages:
I have created one observer & set the description for the current category. But when I tried to set the title then I got the below error.
Recoverable Error: Object of class Magento\Framework\View\Page\Title could not be converted to string in /var/www/html/htdocs/vendor/magento/framework/View/Page/Config/Renderer.php on line 125
I used the below code to set the meta title & description.
$this->_pageConfig->setMetadata('title', 'some meta title');
$this->_pageConfig->setDescription($desc);
$this->_pageConfig->setKeywords($keyWrds);
Thanks for any help.