• Resolved jlk

    (@jlkogut)


    We’ve inserted HTML code to create the format of product title on the SHOP page (www.singalongsoap.com/shop) of our website. However after updating Virtue Theme to version 3.4.2, the HTML code is now displaying in the PRODUCT title on each PRODUCT page. (It wasn’t displayed prior to the most recent update.) How can we retain the existing product title format on the SHOP page while avoiding the HTML code from displaying on the PRODUCT page?

    NOTE: We also updated Woocommerce to version 4.4.1. Could Woocommerce be the culprit? Regardless, what can we do the rectify the situation?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Did you find a solution for this issue? I am having the same issue.

    thanks

    Jeremy

    Thread Starter jlk

    (@jlkogut)

    Yes… Tech Support provided the following information:

    This isn’t a theme controlled thing, woocommerce never intended that you would be able to run HTML in that title. There was an error in their code that allowed it and that error was fixed in version 4.4

    https://github.com/woocommerce/woocommerce/commit/bdf996eec870be788e016a99c44abf21d7406b78

    I don’t know why they didn’t want HTML in the title. You would have to ask the core team about that.

    To allow HTML you would need to override the template you can read about that here: https://docs.woocommerce.com/document/template-structure/

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    However, since we are NOT using a child theme and overriding templates, we opted to install the CODE SNIPPETS plugin and inserted the code below.

    Install https://www.ads-software.com/plugins/code-snippets/

    Then add this into a code snippet, set it to run only on the front end of your site.

    remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_title’, 5 );
    add_action(‘woocommerce_single_product_summary’, ‘custom_woocommerce_template_single_title’, 5 );
    function custom_woocommerce_template_single_title() {
    echo ‘<h1>’;
    echo get_the_title();
    echo ‘</h1>’;
    }

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    Hope this helps.

    jlk

    Anyone who have a fix for this, when you are using a childtheme??
    https://skole-leg.dk/produkt/sengetoej-pokemon/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘HTML Code Displaying in Product Title’ is closed to new replies.