

Maruf scribbled this post.
My God, I’ve only just recently started playing around with SM Forums, and I can honestly say the documentation is God awful. At least, it’s terrible compared to Wordpress. Also, it’s not coded that great- even applying the simpliest of features require plugins (“mods”, as the SMF community call them) and/or hacks.
Anyways, in this case, I wanted to show the page number of the thread in the page title to avoid duplicate title tags. I searched high and low for a few hours, and there is extremely tedious and ridiculous solutions floating around. Someone has even created a plugin (mod package) to apply this feature. To me, that seems a bit O.T.T. You shouldn’t need to install a mod to apply such a simple feature, right? Right. So, this is my solution…
How to show page number in the thread title
Open the file index.template.php, it should be located in the theme folder of whichever theme you’re using.
Search for the following 2 line:
1 2 | // ]]></script> <title>', $context['page_title'], '</title>'; |
Replace it with:
1 2 3 4 5 6 7 8 9 | // ]]></script>'; if($context['page_info']['current_page'] > 1) { echo "<title>" . $context['page_title'] . " [Page " . $context['page_info']['current_page'] . "]</title>"; } else { echo "<title>" . $context['page_title'] . "</title>"; } |
Save changes, upload the file.
It’s as simple as that.
Lord only know why there’s so much static noise over this issue.
If anyone tries this, please let me know how you get on.











feel free to leave a scribble