I want to append "(Page 2)" to my html <title> on each album when I am on page 2 or higher. This way Google isn't indexing duplicate page titles for my paginated albums. I'm using v1.26 currently.
I believe this involves an if statement using the function getAlbumPage() but I'm not really a coder so if someone could point me in the right direction I'd be grateful. Thanks!
Comments
`
<?php if ((getAlbumPage()) > 1) {
echo getBareGalleryTitle().' | '.getBareAlbumTitle().' | Page '.getAlbumPage();
} else {
echo getBareGalleryTitle().' | '.getBareAlbumTitle();
} ?>
`
or if you want page numbers always...
`
<?php echo getBareGalleryTitle().' | '.getBareAlbumTitle().' | Page '.getAlbumPage();?>
`
`
<?php if ((getAlbumPage()) != '1') {<br />
`
I searched further and discovered there is a getCurrentPage() function(!).
So this is the code that worked (again, thanks to you for getting me here):
`
<?php if ((getCurrentPage()) > 1) {
echo '(Page '.getCurrentPage().')';};?>
`
<?php if ((getCurrentPage()) > 1) {
echo '(Page '.getCurrentPage().')';};?>
Thank-you.
– Go in the /themes/Your_theme folder
– Look for files such as album.php, gallery.php, image.php
– Find "breadcrumb" style; this is very likely to be where you have the title of the page displayed
If you mean the page title as seen in google search results you would put the code in between the <title> tags of your album.php file. Just added it to my site and it works wonderfully.