admin管理员组

文章数量:1314216

As of version 5.5.0, WordPress introduced second argument (array $args) to get_header.

I am calling get_header in my templates including index.php and I want to pass meta description value from template to header.php

And I am trying this

$args = array('Index meta desc');
get_header(null, $args);

While in header.php file the value of $args is an empty array.

Not sure, if I am calling the variable correctly.

Any comment/answer will be helpful.
Thank you.

本文标签: How can I pass a variable from a template to headerphp of a theme