I was able to generate a 'back to shop' link on a single product page by adding this code to functions.php
// Add back button to product page add_action( 'woocommerce_single_product_summary', 'back_button', 31 );
function back_button() { if ( wp_get_referer() ) echo '<a href="' . wp_get_referer() . '">Back to shop</a>'; }
I would like to achieve the same on a portfolio item page. Could you please let me know how that could be done ? I tried to find it in the Theme Settings but I could not find the option.
Thank you. I think this is exactly the same code that I already have, and it works for a Woocommerce Single Product Page.
My actual question was how to get it working for a Portfolio Single Page as well, do you know how to do that, I guess I need to 'hook' the action to another page (change the add_action line?)
Dear Kalium support,
I was able to generate a 'back to shop' link on a single product page by adding this code to functions.php
// Add back button to product page
add_action( 'woocommerce_single_product_summary', 'back_button', 31 );
function back_button() {
if ( wp_get_referer() ) echo '<a href="' . wp_get_referer() . '">Back to shop</a>';
}
I would like to achieve the same on a portfolio item page. Could you please let me know how that could be done ? I tried to find it in the Theme Settings but I could not find the option.
Hi there,
Please paste the code below in custom function in function.php
Thank you.
Hi Enroll,
Thank you. I think this is exactly the same code that I already have, and it works for a Woocommerce Single Product Page.
My actual question was how to get it working for a Portfolio Single Page as well, do you know how to do that, I guess I need to 'hook' the action to another page (change the add_action line?)
With best regards,
Bastiaan
Hi kristievannoort,
This options is already available in our theme, please consider reading the article we wrote about Portfolio Item Options.
(view large version)
Thank you.