WebsiteBaker Support (2.8.x) > Templates, Menus & Design
Hide page title
(1/1)
Tinke:
Hello everybody!
I have small problem. I would like to hide the title, image gallery pages.
But how?
--- Code: ---<?php
$path_parts = pathinfo($_SERVER['REQUEST_URI']);
if ($path_parts['dirname']=="/pages/gallery")
echo "NO TITLE";
else
echo '<div class="title">'.page_title('','[PAGE_TITLE]').'</div>';
?>
--- End code ---
This code make to image gallery pages "no title" and every other pages this html code
--- Code: ---My page title<div class="title"></div>
--- End code ---
But html-code should be this
--- Code: ---<div class="title">My page title</div>
--- End code ---
What i am doing wrong :? :? :? :? :? :? :? :? :? :? :x :x :x :x :x
Please help meeeeeeeee.
Regards,
Tinke
DarkViper:
try this
--- Code: ---<?php
if( strpos( $_GLOBALS['wb']->page['link'], '/gallery' ) == 0 )
{
echo 'NO_TITLE';
}
else
{
echo '<div class="title">'.PAGE_TITLE.'</div>';
}
?>
--- End code ---
dfhectik:
unfortunatley that echo's NO_TITLE instead of the title.
Perhaps use page id's.
I have a page that i dont want to display any title on, but on all other pages i want to display the title.
i dont know php to good so my attemps just break my website.
DarkViper:
echo 'NO_TITLE';
'NO_TITLE' is a synonym for a hardcoded title-string only....
you can replace the text between the apostrophs with whatever you want... also leave it empty like '' too.
Navigation
[0] Message Index
Go to full version