Created
September 27, 2011 23:51
-
-
Save rickbenetti/1246589 to your computer and use it in GitHub Desktop.
Exibir quantidade de caracteres no box de resumo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adicionar codigo abaixo dentro do functions do template em uso | |
// Contagem de caracteres do excerpt | |
function excerpt_count_js(){ | |
echo ' <script> | |
jQuery(function($) { | |
$("#postexcerpt textarea").after("<div style=\"float: rigth;margin: 10px;;color:#666;\"><small>Quantidade de caracteres: </small><input type=\"text\" value=\"0\" maxlength=\"3\" size=\"3\" id=\"excerpt_counter\" readonly=\"\" style=\"background:#fff;\">.</div>"); | |
$("#excerpt_counter").val($("#excerpt").val().length); | |
$("#excerpt").keyup( function() { | |
$("#excerpt_counter").val($("#excerpt").val().length); | |
}); | |
});</script>'; | |
} | |
add_action( 'admin_head-post.php', 'excerpt_count_js'); | |
add_action( 'admin_head-post-new.php', 'excerpt_count_js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment