Okay
  Public Ticket #1399127
Back button on portfolio page
Closed

Comments

  • kirstievannoort started the conversation

    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.

  • [deleted] replied

    Hi there,

    Please paste the code below in custom function in function.php

    function back_button() {
        if ( wp_get_referer() ) echo '<a href="' . wp_get_referer() . '">Back to shop</a>';
    }
    add_action( 'woocommerce_single_product_summary', 'back_button', 31 );

    Thank you.

  • kirstievannoort replied

    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

  • [deleted] replied

    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.