Tagged: schmidtgrafisk
-
AuthorPosts
-
November 10, 2023 at 11:48 am #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 ;)
November 11, 2023 at 11:31 am #1425280Hey 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,
RikardNovember 24, 2023 at 7:15 am #1426364Good morning Rikard
I’v just share a couple of screenshots / link below.
• shop
• itemOn 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 ;)- This reply was modified 1 year, 1 month ago by Schmidtgrafisk.
November 24, 2023 at 9:42 am #1426377Hi,
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,
IsmaelNovember 24, 2023 at 10:32 am #1426389Hi Ismael
Using the code made two lines, now I need the second line to be italic ;)The site is using the ShopLenter plugin
Thanks ;)
November 25, 2023 at 7:08 pm #1426448Hi,
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:
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,
MikeNovember 27, 2023 at 9:45 am #1426512Thanks I´ll have a look at the plugin setting to avoid to much extra coding
Thanks to all of you ;)
November 27, 2023 at 10:50 am #1426516Hi,
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 -
AuthorPosts
- The topic ‘How to format in the webshop’ is closed to new replies.