• Resolved jerubei

    (@jerubei)


    Hello,

    I’d like to display an HTML table with product sizes, which is specific for every product. I used a tables generator, but when I switch between the visual and text editor, it ruins the CSS.

    Can you recommend a solution, which won’t break the HTML and I can still use the visual editor? Maybe some additional field, where I can only insert the HTML code?

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @jerubei,

    Great question. Switching back and forth between the visual and text editors can definitely cause problems. What you may want to do is use a plugin that turns your HTML into a shortcode. That way you can insert it into the visual editor and it will be rendered correctly. See if something like this works for you.

    https://www.ads-software.com/plugins/shortcoder/

    Cheers

    Thread Starter jerubei

    (@jerubei)

    Thank you for your reply!

    I don’t think that would work – I would have to create a shortcode for every single product. Maybe I need an extra field to enter this information, but I can’t seem to find a suitable plugin or code to implement it.

    Hi @jerubei,

    You are correct that this would require a shortcode for each table that you want to create. It is possible to create an extra field to enter this code using something like Advanced Custom Fields. That plugin allows you to create extra fields like this for any content type including WooCommerce Products.

    However, it does not automatically display the information on the front-end of the site. That will require some custom coding to make it happen. This builds on top of the custom field system that’s part of the WordPress core. To get started with it, take a look at this post from WP Beginner.

    https://www.wpbeginner.com/wp-tutorials/wordpress-custom-fields-101-tips-tricks-and-hacks/

    Let us know if you have any questions.

    Thread Starter jerubei

    (@jerubei)

    I believe this is exactly what I was searching for – thank you, I really appreciate your help!

    Hi @jerubei

    Glad to hear @3sonsdevelopment’s solution was helpful. I’m marking this thread as resolved now. If you have any further questions, please feel free to open a new topic.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Displaying HTML table in product description’ is closed to new replies.