Support

Account

Home Forums Front-end Issues Wysiwyg replaces spaces with  

Helping

Wysiwyg replaces spaces with  

  • This issue is causing the text to have no linebreaks. I have tried to replace the   in php, however it does not change much, only reveals the <p> tags on both sides. I have followed the documentation but the text is still on only one line and goes past the edge of the screen.

    <?php $background = get_field('bakgrund');?>
    						<div class="column width-8">
    							
    							<?php
    								$infostring1 = html_entity_decode($background['del1']);
    								$infostring1 = preg_replace("/\s/",'',$infostring1);
    								$infostring1 = htmlentities($infostring1);
    								echo $infostring1;
    							?>
    							<?php echo $background['del2'];?>
    						</div>

    I have tried to remove wpautop, replace the   etc. I haven’t seen any other people having these issues so i’m completely lost here. Appreciate any help.

  • I can only assume that you have a group field called “bakgrund” and “del1” is a wysiwyg field sub field of this group.

    getting the field should format the wysiwyg sub fields

    I am lost as to why you are doing this

    
    $infostring1 = html_entity_decode($background['del1']);
    $infostring1 = preg_replace("/\s/",'',$infostring1);
    $infostring1 = htmlentities($infostring1);
    

    as it is removing all of the html formatting applied to the wysiwyg field.

    Why are you not just using echo $background['del1'];

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.