![]() |
Adding <link rel="prev" etc
Has anyone been successful in adding <link rel="prev and "next" tags in their threads? I see most current software is doing this regardless of physical pagination.
|
I try it with the
Code:
<if condition="$show['next']"><link rel="next" href="$address$address2&page=$nextpage</if> |
Thanks for posting the suggestion, even though the question was asked thirteen months ago. :p
|
But is not solved.
I try something in the function.php by line 2405 to add the headinclude, but it doesnt work. |
1 Attachment(s)
Just to be clear, you are trying too add something like in the attached screenshot?
|
Quote:
PHP Code:
Edit: (I replaced the above code - I copied the wrong version). |
Works fine with this code:
Code:
if ($pagenumber > 1) |
How would you do this without making changes to functions.php?
Is there a way to get the variables you need by using a plugin? Been stumped on this one for a while. Cheers, hilaryl |
So, is there a solution for adding prev / next in head?
PP - Sorry, the code above works fine - thank you |
Quote:
Have been looking for a solution to this issue for a while now - and this is perfect. Had to tweak a few things to allow for my URL structure - but it's working perfectly now. Also added in an if statement to cater for being on page 2 and not including a 'page=1' to the previous page. THANK YOU VERY MUCH!! |
Quote:
Thanks to everyone who contributed. This is good stuff. Two questions: When I create the plugin, what hook do I attach it to? Do I need to put a variable into the headinclude utilize the results of this code? |
First i would like to thank you kh99 and Ameise, the code on post #7 works perfectly for SHOWTHREAD and FORUMDISPLAY pages.
The unique problem is with tag pages, on the second page of the tags it adds a rel="prev" <link rel="prev" href="http://www.vbulletin.com/tags/messenger-page1.html" /> When it should simply be <link rel="prev" href="http://www.vbulletin.com/tags/messenger.html" /> I'm using vBSEO anyway when i disable it, it also add &page=1. Any idea how can this be fixed? Thanks! |
Yeah, hilaryl mentioned that he (or she) add a line for that. I guess it would be something like:
PHP Code:
|
Hi Guys,
Sorry I didn't get back earlier - missed the notification! kh99's example of the code with the page alteration is exactly how I have it. For darnoldy: The hook I used was pagenav_complete, and because the code is adding data to the already implemented $headinclude variable - you don't have to add anything to your templates. Just activate the plugin and it will do the rest. Thanks, hilaryl |
Thanks for everyone. This is working perfectly...
|
All times are GMT. The time now is 05:23 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|