Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1425207

    Hi Enfold
    When you look at the shop the text is show different than it is on product pages.
    Please help to set the text at the shop is set as on the product pages.
    Danish text as bold, then a line brake and UK text as italics but not bold.

    Thanks ;)

    #1425280

    Hey Alan,

    I’m not sure I understand which text you are trying to target and how. Please provide us with a further explanation of your intentions, or post a screenshot highlighting them.

    Best regards,
    Rikard

    #1426364

    Good morning Rikard

    I’v just share a couple of screenshots / link below.
    • shop
    • item

    On the item pic I got the text in two lines, first line Danish, second line uk.
    The two lines are formatted differently, and I’d like to have the same formatting in the shop, if it’s possible.

    On the shop pic the text is just one sentence.

    Please have a look
    Thanks ;)

    #1426377

    Hi,

    Thank you for the inquiry.

    Looks like you’re using a plugin to display products on the shop page. And it seems to strip all html tags from the product description, causing the text not to move to the second line. Could you share the name of the plugin? To shift the description to the next line, give this css code a try.

    .<a href="https://refer.wordpress.com/r/84/woocommerce/" target="_blank" rel="nofollow">woocommerce</a>-product-details__short-description {
        width: 82%;
    }

    Best regards,
    Ismael

    #1426389

    Hi Ismael
    Using the code made two lines, now I need the second line to be italic ;)

    The site is using the ShopLenter plugin

    Thanks ;)

    #1426448

    Hi,
    Thanks for the screenshots, unfortunately as Ismael pointed out your plugin has stripped the HTML out and all of the text is in one paragraph tag:
    Enfold_Support_3980.jpeg
    so ther is no way to style only half of the text.
    But when I look at your webshop all of the items have the same text “Scarf in knittet and feltet pure wool” so based on this text we can add the italic to the text.
    Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
      <script>
    function wrapText(node, text, wrapper) {
        if (node.nodeType === 3) {
            const idx = node.nodeValue.indexOf(text);
            if (idx !== -1) {
                const span = wrapper.cloneNode();
                const wordNode = node.splitText(idx);
                wordNode.splitText(text.length);
                span.appendChild(wordNode.cloneNode(true));
                wordNode.parentNode.replaceChild(span, wordNode);
            }
        } else if (node.nodeType === 1) {
            Array.from(node.childNodes).forEach(child => {
                wrapText(child, text, wrapper);
            });
        }
    }
    
    const textToWrap = "Scarf in knittet and feltet pure wool";
    const wrapperSpan = document.createElement('em');
    
    document.addEventListener("DOMContentLoaded", function() {
        wrapText(document.body, textToWrap, wrapperSpan);
    });
    </script>
      <?php
    }
    add_action('wp_footer', 'custom_script', 99);

    Then add this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:

    #top .all_colors p em {
        font-style: italic;
        font-family: "open sans";
        font-weight: 400;
    }

    then clear your browser cache and check.
    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.

    Best regards,
    Mike

    #1426512

    Thanks I´ll have a look at the plugin setting to avoid to much extra coding

    Thanks to all of you ;)

    #1426516

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘How to format in the webshop’ is closed to new replies.