richd.com

add custom title to Classic Blogger FTP label pages

On Classic Blogger templates for FTP, label pages do not have custom page titles.
This PHP code is for adding the label name to the page title.

<title><$BlogPageTitle$>
<?php
// this checks to see if you are on a label page
if(strstr($_SERVER['PHP_SELF'],'/blog/labels/')) {


// this generates the label name
$FilePath = explode("/", $_SERVER['PHP_SELF'] );
$FilePath = array_reverse($FilePath);
$LabelName = explode(".", $FilePath[0]);
echo ": ". $LabelName[0];


}
?>
</title>

Labels:

add custom html to Classic Blogger FTP label pages

I have a back button on my archive pages that wasn't showing up on my label pages.
On Classic Blogger templates for FTP, the <MainOrArchivePage> tag doesn't work with label pages.

This is for adding a home button (or custom content) to a label page.

<?php
// place this code wherever you need it.
// this checks to see if you are on a label page.
if(strstr($_SERVER['PHP_SELF'],'/blog/labels/')) {


// note the backslashes before the double quotes.
echo "<a href=\"<$BlogURL$>\"><$I18NHome$></a>";
}
?>

Labels:

archives