If you have been paying attention to Amazon’s single product pages and if Amazon’s engineers have been doing their job well, you have most likely clicked on one of the links in the group of deep links called “Customers who bought this item also bought”.
This plugin tries to create a similar group of links for your blog. If you have enough links in your theme (Contextual Related Posts plugin comes in handy) for readers to explore, then as and when readers click on links, this plugin checks to see if it was referred from your blog, checks to see if it can identify a post or a page from the information it has and then adds a link to the referring page. I have been testing it on this blog for a few days while I iron out the bugs. Check out the pages and what grabs readers’ attention on various pages and posts.
Installation is very simple, just download, unzip, upload and activate. The plugin should automatically add the list to the bottom of every single page right before the comment form. Please refer to the plugin file for troubleshooting hints. Future development plans include an admin page to control the number of links, autoplacement etc.
Please let us know if you are using the plugin and whether you like it. Bugs should be posted here.
[EDIT] I have noticed a bug on some blogs and the following might be a quick fix. If your footer.php template file does not have the correct “actions” described, you will notice that the links are not generated and the N/A stays on the post. Take a look at the default footer.php in the wordpress theme folder and make sure the wp_footer() function is in your footer template. Basically, it needs to have the following line right before the close of the body and html tags.
<?php wp_footer(); ?>
New Version 1.3
Download Where did they go from here? v1.3
New Version 1.4
Download Where did they go from here? v1.4
Hi Mark, sounds like a good idea. I am using this plugin but have 2 questions about it
1. How much time it takes to show up the link.
2. I have removed hook added at the end ( that makes it appear just before commenents) and called the funcion instead. Doest it affect ?
I like this idea. I’ma try it out on my site.
Ashish, that should be fine.
Just testing this out on Sciencebase, I’m just seeing N/A at the moment, but hopefully as visitors come and go it will begin to populate, there are 1000+ posts on that site to choose from so, hopefully…soon……
db
Hi,
after activating the plugin I get under the line: Readers who viewed this page, also viewed: a little sign and N/A
something went wrong ???
Greetings
Klaus
Klaus, that is normal. Just click on one of the outgoing deep links in your blog and the NA should change to links.
Somehow it only appears on my single.php but not on index.php… Do you give me any advice how I can fix that? Thanks 🙂
@Mark: I tried clicking some of the related links and re check it again. No links appear. Seems like it takes time. I will test it for a day and Will tell you if it works
Ok, I’ve found how to add that plugin to index page as well but now I can’t find how to add Contextual Related Posts plugin to index page LOL
Ashish, sent you an email with the information in the edit in the post above.
Inga, none of these plugins are meant or coded to be displayed on the front page. Doing so might break things and/or confuse your readers.
@Mark: oh… I see, ok, then I go and remove it from index.php better… Thanks.
@Mark : Is there any restriction that it works with your Contextual Related Posts plugin. The wp_footer function is called in my theme
If my host lets me activate plugin,i will try it. 🙂
It looks awesome.I must use it.
What would be really sweet is a mod that would coordinate the “related posts” and “also read” posts so they don’t overlap. I would guess that people are very likely to click on the “related posts” at the end, which would also put the post on the “also read” list more times than not. E.g. above, where the Jabberbot plugin post made it onto both lists. With a little tweaking, I would think someone could make the plugin look for overlapping posts and omit them from one list or the other.
Great idea for a plugin, btw. Seems that it would be great for increasing page views within a site/blog.
It looks great. thanks
Ashish, there is no co-relation between the two plugins. There are probably suppressed warnings that would help a lot in finding the bug.
@Mark: Thanks for the update. I will be testing it for a complete day and lets see if it works. Will update you here
can’t get it to work… what did i missed?
Huh. I thought the title of this post actually referred to a story about where certain plugin authors went (e.g. started out writing plugins and look where they ended up!!).
Guess I should pay more attention next time. 😉
Doesn’t seem to work on my site.
I manually removed the hook in the plugin file and added the show_where_they_go call to my comments.php but the links don’t show up.
Affenheimtheaterbesitzer: Take a look at the edit at the bottom of the post. See if that is where things are breaking. There might be another bug I have not quite pinned down yet. If you can turn on warning messages for your server, there should be a warning at the footer that would help a lot in debugging.
How do you move it up to where you have it? Right now it shows up underneath where a reader would comment on my blog.
I just installed this plugin and like Ian, I get the list between the comment box and the submit button. How do we customize it to have it display in a specific part of a post? Thanks!
I agree with Ian: how did you have it appear at the top? My related entries are before my comments, and that would be the perfect place to put them.
Same question as Jaypee and lan … it shows under the comment entry. How do I move it up, just under the article ?
Jaypee, Ian, khrys, do the following to achieve your objective:
Remove the following line from the plugin:
add_action(‘comment_form’,’show_where_they_go’);
Add the following line to your single.php where you want the list to display:
<?php wp_footer(); ?>
@Mark:
I tried it, and it didn’t work. It gave me a WP error, or it would show footer stuff in the wrong location.
But I did find a way. I change it around in:
add_action('comment_form','show_where_they_go');
… to:
add_action('show_where_they_go','comment_form');
And then, I added the php string, as indicated in the plugin file, to the exact location I wanted in my single.php template:
Michel,
That works because the add_action is backwards in your case. Just remove that line and it should have the same effect. Glad you got it working! 🙂
Thanks Mark! It’s now working perfectly on my blog. 😀
What I did was:
1. Remove this line from the plugin file – add_action(‘wp_footer’,’add_wherego_count’);
2. Copy this line of code to where I want it to be displayed –
I removed both the hooks, Add the hook add_action(’wp_footer’,’add_wherego_count’); to where I want to display….doesnt work still
Well, I actually read your instruction in the php file, and those worked. I also commented out the add_action(’comment_form’,’show_where_they_go’); part.
Now it shows, but it seems to always be N/A … I guess it takes some time to change …
Sounds like a great plug in (found this off of Digg). Thanks for sharing!
Please, move the “Readers who viewed this page” inside the if block that follows.
I can provide the trivial patch on request.
Thanks
I installed and activated, but nothing happens. I like the idea though.
Ohhhh I get it… This only works if comments are enabled. I wonder how to change this to make it work with comments disabled.
I’m getting this error;
Warning: unserialize() expects parameter 1 to be string, array given in /home/mydomain/wp-content/plugins/wheredidtheygov1.php on line 63
Can you help me Mark?
Thanks.
Pande, wonderful catch! Fixed bug and uploaded new version 1.3
Please let me know if that works.
The plugins still says it’s Version: 1.2
So, is it better to even if I didn’t see any errors with previous one?
Gosh, part of my comment was gone :-S The question was: is it better to upload new version now even if I didn’t see any errors with previous one?
Pande, it should say 1.3. I just checked it again.
Inga, it would probably make sense to upload the new one since the bug might have caused some problems.
Also translated this one, contact me if you want the file
I did what you recommend in comment #28 but still getting similar error at the bottom of the page:
Warning: unserialize() expects parameter 1 to be string, array given in /home/myURL/wp-content/plugins/wheredidtheygov1.php on line 64
This is fun. Thanks.
Still seeing the N/A on Sciencebase.com with this plugin, even after rendering the suggested patch, I was hoping to blog about it and trackback here with my success story, but unfortunately that will have to wait till someone suggests another fix…
db
I’ve just let on
http://perassi.org/2007/06/06/.....go-plugin/
a simple patch for the users that don’t want to see the “N/A” that appears when $lpids is 0
Now is OK, but I can’t place the list of article where I want. If I call
and delete the line you said get an error.
This looks good to have. I have been running Auction Ads for some time and have wanted to include Amazon on the site too. I shall give it a try!
This Plugin is a great idea and works nicely for me.
The default installation didn’t mesh well with my theme so I did the following:
1) commented out the this line in the plugin:
add_action(‘comment_form’,’show_where_they_go’);
2) added this function call to my single.php file:
show_where_they_go();
That allowed me to place the list wherever I wanted without having to worry about my severely hacked footer getting in the way of things.
I’m interested, but I’m worried about a couple things:
1) How much database bloat will this cause if I install it, and where’s the data stored? A unique table that I can easily clear out, or a new field in the posts table?
2) Does it track both inbound and outbound views? (In other words, when a visitor clicks from page A to page B, do both page A and B show the relationship?)
3) Does it use a cookie to determine page relationships over time so that if I visit page A on Monday then return to visit page C the next week, will it register a relationship? Or is it only tracking referrers from within my site?
Looks interesting, but if it’s only going to show people the links that already exist on-page, then it’s information overload.
Rich
BlogRodent
Hi:
I’m having the following error message at the end of the blog:
“Fatal error: Call to undefined function: attribute_escape() in /home/.august/ultrapodcaster/ultrapodcaster.com/wp-content/plugins/wheredidtheygov1.php on line 49”
Any ideas? Thanks! I’m using WP 2.0.2
Alejandro, you really need to upgrade your version of WordPress.
Cool plug-in, thanks. I use it on my site but have modified your code so that the header and links appear only when there is something to link to. IMHO, there is no need for an “else” statement. Take a look:
if ($lpids) {
echo "Readers who viewed this page, also viewed:";
foreach ($lpids as $lpid) {
echo ''.get_the_title($lpid).'';
}
echo "";
}
You might think about doing this for your next patch release of the plug-in.
Hey! its a very cool plugin, but it doesnt run on my blog 🙁 i have already checked this thing with the footer … everything is allright. some error should occur in the add_wherego_count() function, because it doesnt even wright the meta to the post. i’ve tried to echo the $id = $post->ID but it returns an empty value. $matchvar returns 1.
please help ^^
i’m getting N/A all the time.
checked my footer… that seems to be ok.
Any further ideas?
This Plugin sounds nice, but it does not work in my wordpress. I checked footer. I added a debug-message in the function add_wherego_count. The message is written in the blog, so the function had started, but it makes no entries in the database. Any suggestions?
Ok, my error_reporting was switched off. Now I can see, whats the problem: I have to update my wordpress because a function is not defined. 🙁
Great Plugin! … and I got it to work, but I had to make a code change to a line that seems to have a typo.
I downloaded ver1.3 from the link above and it wouldn’t store anything in the db. always said N/A.
changed
$sitevar = str_replace("/","\/",$sitevar);
to$sitevar = str_replace("/","",$sitevar);
and it started working.I’m confused as to how it ever worked for other people, but happy that it works for me now. 🙂
It still do not work for me even after those changes. Any ideas? What was the code you put on the site?
Thanksm this made it work for me along with 29 above. Cheers!
mmm…This is strange.
The plugin was working beautifully until last year.
But data is not being updated since Jan 1st 2008.
Does anybody have a fix to this?
Oh, by the way one specific post appears for all the entry since Jan 1st.
Would really appreciate any suggestions.
Thanks 🙂
Thank you for this pretty good plugin!
But i get a problem, that is it occurs below the comments form…
So, i made some change of your plugin~~
I have the same problem. The plugin is beneatht the comments box on my pages too. What changes did you make to make it run smoothly?
Cheers
Dave
This plugin is pretty good!
But i got a problem, that is it appears below the comment form…
So i made some changes to make it running well.
I’m getting the following error message:
warning: unserialize() expects parameter 1 to be string, array given in /home/xxxxxxxx/public_html/wp-content/plugins/wheredidtheygov1.php on line 97
I think this coincided with the upgrade to 2.6, though I’m not positive of that. Any ideas?
Plugin should be updated. 🙂
Looks great — thanks for the update!
Probably does have to do with 2.6 Jamie, Look for an update soon.
I’ll confirm that WDTGFH has been quirky since I upgraded to WP2.6. Three different cases. Strange thing though is that on some pages it works no prob, others gives the same error Jamie’s getting. I’ve not been able to figure out a pattern.
Looking forward to the update though. Thanks!
Thanks. I will try it locally before uploading it to my server.
I like the sound of this plugin, but was wondering if it was possible to change the location from the bottom of the page; I am interested in having it in the sidebar.
Thanks
I downloaded version 1.4 from the link above and tried it. But I got a warning “Invalid argument supplied for foreach()”
I add a line code after:
$lpids = get_post_meta($post->ID, ‘wheredidtheycomefrom’, true);
$lpids = unserialize($lpids);
Now, It’s working perfectly on my blog.
BTW: The WP version used is 2.3.2
Hi Mark! I’ve been having a problem I didn’t see related here… my blog shows the links, but inside the commentform! only problem is, my commentform is configured to not showing as default.
Check it out: http://www.proveisso.net/2008/.....s/#respond
anyway to work it around?
This plugin was not working in my localhost and in live then I edited this line and works like a charm
//$matchvar = preg_match(“/$siteurl/i”, $sitevar);
$matchvar = true;
I am using version 1.4
It works for me, but without being able to style DIV tags, I can’t make it work well with my theme. Too bad, this would be a cool plugin otherwise 🙁
It works in the site I am testing it on, but below the comment form.
Also, is there a way to make it appear on the main page where the latest posts ar shown?
Thanks for this plugin
Francisco