Add a static block as hook in the product single page

This topic has 3 replies, 3 voices, and was last updated 1 months, 1 weeks ago ago by Andrew Mitchell

  • 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.

    2 Answers
    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

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    October 18, 2024 at 15:11

    Dear Tiffany,

    Choosing our theme reflects your commitment to quality, and for that, we’re genuinely grateful. As we constantly strive to elevate your experience, your feedback is an invaluable gift. Could you kindly take a moment to rate our product with 5 stars on ThemeForest?

    Click here to share your insights: https://themeforest.net/downloads

    Your support fuels our journey, and we appreciate it more than words can express.

    Best Regards,
    The 8Theme Team

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

The issue related to '‘add a static block as hook in the product single page’' has been successfully resolved, and the topic is now closed for further responses

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.