Set Title from Custom Template

Use global variables to pass values from the template to the header. // in the template file global $my_page_title; $my_page_title=”field value”; global $my_meta_description; $my_meta_description = ‘field value’; get_header(); // in the header file global $my_page_title; global $my_meta_description; echo $my_page_title; echo $my_meta_description;

Functions For Calling Specific Elements

It sounds like get_template_part() would do the trick. In element.php you could simply call get_template_part( ‘element-item’ );, which would then include the element-item.php file from your theme. You could wrap this up in a function if you wanted to, e.g. get_element(). function get_element() { get_template_part( ‘element-item’ ); } This approach would allow you to add … Read more

Whats the template of my homepage?

Themes authors have different approaches and organize their files differently. The fastest way to know which theme files were used to generate the current page is to use the plugin What the File, it adds a small section in the admin toolbar.

How to make the Primary Menu stay the same in the PC and mobile versions of the Twenty Sixteen theme

Add below css in your theme style.css file, change font size if you need @media screen and (max-width: 56.875em) { .main-navigation li { float: left; width: 33.333333%; text-align: center; font-size: 12px; } } UPDATE: To make menu items inline apply floats on list elements not on nav tag I checked using inspect elements and code … Read more