Forum
Dynamic title field in head
Hi,
I want to make my post.php title field dynamic and get it from postTitle
.
<title><?php echo $title; ?></title>
I am running default variables before the <html> and change those witch are different. In this case I want to call postTitle
.
<?php include('include/default-vars.html'); // Different variables go below
if (perch_get('s')) {
$title = perch_blog_custom(array(
'template' => 'slug2.html',
'filter' => 'postSlug',
'match' => 'eq',
'value' => perch_get('s') ));
}
echo $title;
?>
Echo is working but is not setting the variable... any idea?
You need to return the value:
Thanks!