WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the hyphenator.js to custom page template and works for paragraph, but I can not apply it to Post. How can do that?


<script type="text/javascript" src="https://raw.github.com/bramstein/hypher/master/dist/jquery.hypher.js"></script>

    <script type="text/javascript">
     $(function() {


post-single {text-align:justify; font-size:1em;}


<div class="post-single" id="post-<?php the_ID();?>">
<div class="title-single"><h3><?php the_title(); ?></h3> </div>
<div class="posted">
<em>Posted <?php the_time('l, j F Y') ?>.</em></div>

        <?php the_content (); ?>


The problem with the class resolved, but the hypernate .js doesn't work to IE. How can fix that?

share|improve this question

While inserting js directly in header.phpcan work it's not recommanded to do that. You'd better add your scripts to the WordPress queue:

function wpse_109879_insert_hyphenator() {
 wp_register_script('hyphenator', 'https://raw.github.com/bramstein/hypher/master/dist/jquery.hypher.js', array('jquery'), null , false);


Regarding CSS you probably use the wrong class, you can try .single-post or .single

EDIT: I see you use raw script. Maybe you'd better copy paste code from github into another js file you can call directly from your theme. This would allow to insert code you use to initialize hyphenator so you have only one file to manage hyphenator.

share|improve this answer
i add more information about 'single-news.php'. If i add his script to WP queue, the hyphenator don't work for custom page template. – MikeD Aug 13 '13 at 12:15
After many times of efforts. Ι "reload" the js of language and the script load for paragraphs of post. I think that the problem, that the problem resolved but I say that with caution. – MikeD Aug 13 '13 at 14:19
But the text-justify and hyphenator.js doesn't work for other browsers like Chrome and IE. How can fix that? – MikeD Aug 31 '13 at 11:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.