Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #509085

    Hi,

    I’m trying to add a ‘Back’ button after the H1 on single product pages. I’ve tried using the approce mentioned here; https://kriesi.at/support/topic/add-code-in-page-title-container/ but can’t get it to work.

    <div class=”summary entry-summary”>
    <h1 itemprop=”name” class=”product_title entry-title”>Guardian Angel</h1> AddBackButtonHere

    See muckup here;
    http://www.crowdmade.dk/wp-content/uploads/2015/09/Back_muckup.jpg

    Brg.
    Per

    #509430

    Hi Per!

    Thank you for using Enfold.

    Where do you want to the “Back” button to go? If you want to go back to the previous page, try this in the functions.php file:

    add_action( 'woocommerce_single_product_summary', 'woocommerce_single_product_summary_button', 11);
    
    function woocommerce_single_product_summary_button() {
    	echo '<a class="back_button" href="#" onclick="window.history.back()">Back</a>';	
    }

    Use the “.back_button” selector in the Quick CSS field in order to adjust the position of the button:

    .back_button {
        position: absolute;
        right: 0;
        top: 0;
    }

    Regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.