Adding gallery title to page title
-
Hi, I’ve searched around and tried different things but can’t find a solution.
For crawling purposed I’d like to have each gallery/album have its own unique page title instead of it being just the page title that the shortcode was inserted on.
I’ve done part of this with a function in functions.php updating the canonical URL for each album/gallery. Now I’d like to update the page titles so they take into account the actual gallery I’m viewing.
I was suggested to try the code below as a start but can’t figure out how to implement it in a function that returns the page title. I can staticly set a page title via another simple function and just want to feed it the current gallery title to do the rest.
$router = C_Router::get_instance();
$slug = $router->param(‘gallery’);
$gallery = C_Gallery_Mapper::get_instance()->get_by_slug($slug);
return $gallery->title;Any ideas? Advice? Links? Just need a hint on best way to handle it.
Thanks!
- The topic ‘Adding gallery title to page title’ is closed to new replies.