Add a static block as hook in the product single page

This topic has 2 replies, 2 voices, and was last updated 9 minutes ago ago by Rose Tyler

  • Avatar: Tiang
    Tiffany
    Participant
    October 18, 2024 at 11:12

    Hello, good afternoon, how are you?

    I have added some text to my product single page from the theme’s function.php. The problem is that by adding it with code, it does not allow me to translate this text on the pages in other languages. The code I used is this:

    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_custom_content', 12 );
    
    function woocommerce_template_custom_content(){
    	echo "<h4>Handcrafted ✂︎</h4>";
    }

    What I want to do is add, instead of this text, a call to a static block that I have already created, and place it in this same position so I can translate it.

    I need help on how I can create the code in function.php to add the static block that I want in this same place of the text created in the code that I mentioned.

    1 Answer
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    October 18, 2024 at 12:55

    Hello, Tiffany,

    Thank you for reaching out to us with your query. We understand that you would like to replace the static text in your product single page with a static block.

    Please check examples of using do_shortcodehttps://www.8theme.com/search/?bbp_search=do_shortcode&bbp_forum_id=128990

    Best regards,
    8Theme’s Team

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.