Okay
  Public Ticket #2687497
Widows
Closed

Comments

  • Joshua Moses started the conversation

    I've been reading up on how to avoid orphans/widows or one word on one lines.  I've even seen custom code that scans the site to remove all instances.

    I eventually found the way to prevent widows and orphans in a fluid-width situation in the form of a beautifully simple sideways approach to the problem from Tom Elliott on WebDevDoor. His suggestion was to include a short snippet of js which scans all paragraph text on a site and replaces the space between the last two words in each case with   – causing the page to read it as one and break the line one word earlier.

    <script type="text/javascript">  $('p').each(function(){    var string = $(this).html();    string = string.replace(/ ([^ ]*)$/,' $1');    $(this).html(string);  });
    </script>
    

    Is this even possible within Salient?

  •  8,848
    Tahir replied

    Hey Again,

    We have a Custom JS code box in Salient Theme Options Panel-> General Settings where you can add the custom code.

    Also, you might have to change the "$" sign to "jQuery" for it to work.

    Thanks 


    ThemeNectar Support Team 

  •   Joshua Moses replied privately
  •  2,963
    Andrew replied

    Hi Joshua Moses,

    You will have to use the Yoast Plugin for this as it can be changed here : https://yoast.com/help/change-breadcrumb-title/#woocommerce . 

    Thanks