Just started learning PHP and Wordpress.
Why isn't my PHP include statement working in the following header.php
file?
<!DOCTYPE html>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<title>
<?php include 'functions.php';?>
<?php if( is_page(1406)): ?>
<?php wp_title(' - ', true, 'right'); ?> <?php get_1406_page_title(); ?>
<?php else: ?>
<?php wp_title(' - ', true, 'right'); ?> <?php bloginfo('name'); ?>
<?php endif; ?>
</title>
.
.
.
I need to call get_1406_page_title()
which is located in the functions.php
. The above code produces empty page, and when I remove the include line the title is empty.
Here is the get_1406_page_title()
from functions.php
:
function get_1406_page_title()
{
$title = "Page title here";
return $title;
}
function.php
- it is loaded automatically.get_1406_page_title()
.wp_title()
, it is a supported theme optionget_1406_page_title()
source.