Back one directory in php

I am building a wordpress site with galleries in it and want to add a ‘Back to Gallery’ link in my single-attachment.php that will send the user back one directory.

For example, if the image is at www.site.com/galleries/gallery1/image1/ I would want the link to send it back to www.site.com/galleries/gallery1/.

Any suggestions would be appreciated.

Read more here: Back one directory in php

Leave a Reply

Your email address will not be published. Required fields are marked *