php coding - fix the previous page link

The current "back to" link goes to the parent category & not the previous page.
On this page:

Click on the Collage tile (3rd in 1st row) & see how the  "back to" link that takes you to the parent category & not the previous page.

Several of these posts belong to more than one category.  I want the "back to link" on this page to go to the previous page,  not the parent category that is sometimes one of 2 or 3 parent categories & not the previous page.

Can you show me how to edit the php file to fix this?

Thank you!

Attached is the current single_product.php file.

Who is Participating?
You can add this line in your code to go back one page..

<a href="javascript:history.go(-1)" title="Return to the previous page">&laquo; Go back</a>

The code in your file is correct to go to the parent category. I will keep both the links on the product page. So user can decide where to go.
Alicia St RoseOwner & Principle Developer/DesignerCommented:
I'm not directly answering your question but just wanted to suggest that you move your bottom menu with "View Cart" to the top of the page. Right now it's below the fold and not very user friendly. You could move it to the very top right of your header...

The site looks great!

Okay, now I'll bud out because I don't have the answer to your question.

carolsanjoseAuthor Commented:
Thank you!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.