How to set page title of NGG gallery pages?
-
This is the page where I’ve inserted an Album:
https://advancedesignstudio.com/kitchen-renovations/
This is gallery under this album:
https://advancedesignstudio.com/kitchen-renovations/images/kitchens/sophisticated-nostalgia-kitchen-in-deer-parkAll galleries and the main album have the same page title. I want to show Gallery’s name as the page title on Gallery’s page.
For example this gallery: “Sophisticated Nostalgia Kitchen in Deer Park”
here:
https://advancedesignstudio.com/kitchen-renovations/images/kitchens/sophisticated-nostalgia-kitchen-in-deer-parkshould have a page title “Sophisticated Nostalgia Kitchen in Deer Park”
instead of
“Kitchen Remodeling and Design in Barrington, Arlington Heights”.How do I do this?
I’ve tried the following code but it doesn’t work:
<?php
// get ngg album info
$gallery = nggdb::find_gallery(get_query_var(‘gallery’));
$album = nggdb::find_album(get_query_var(‘album’));
?><!– Meta !–>
<title><?php// nicer titles
if ($gallery){
echo $gallery->title.’ | ‘;
}else if($album){
echo $album->name.’ | ‘;
}else{
wp_title( ‘|’, true, ‘right’ );
}// Add the blog name.
bloginfo( ‘name’ );// Add the blog description for the home/front page.
$site_description = get_bloginfo( ‘description’, ‘display’ );
if ( $site_description && ( is_home() || is_front_page())){
echo ‘ | ‘, $site_description;
}?></title>
Please help.
The page I need help with: [log in to see the link]
- The topic ‘How to set page title of NGG gallery pages?’ is closed to new replies.