En la seccion añadir comentario justo debajo tengo añadidos los iconos"smiles"
con este codigo en el archivo de mi theme comments.php
Código PHP:
<!-- AQUI EMPIEZA EL CODIGO PARA LOS EMOTICONOS WORDPRESS CON 1 CLICK -->
<script type="text/javascript">
function emoticonos(tag) {
var myField;
if (document.getElementById('content') && document.getElementById('content').type == 'textarea') {
myField = document.getElementById('content');
}
else if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') {
myField = document.getElementById('comment');
}
else {
return false;
}
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = tag;
myField.focus();
}
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
var cursorPos = endPos;
myField.value = myField.value.substring(0, startPos)
+ tag
+ myField.value.substring(endPos, myField.value.length);
cursorPos += tag.length;
myField.focus();
myField.selectionStart = cursorPos;
myField.selectionEnd = cursorPos;
}
else {
myField.value += tag;
myField.focus();
}
}
</script><br><p>Haz click en los emoticonos para usarlos:</p>
<img src="wp-includes/images/smilies/icon_smile.gif" alt=":smile:" onClick="emoticonos(':smile:');">
<img src="wp-includes/images/smilies/icon_biggrin.gif" alt=":grin:" onClick="emoticonos(':grin:');">
<img src="wp-includes/images/smilies/icon_razz.gif" alt=":razz:" onClick="emoticonos(':razz:');">
<img src="wp-includes/images/smilies/icon_lol.gif" alt=":lol:" onClick="emoticonos(':lol:');">
<img src="wp-includes/images/smilies/icon_wink.gif" alt=":wink:" onClick="emoticonos(':wink:');">
<img src="wp-includes/images/smilies/icon_mrgreen.gif" alt=":mrgreen:" onClick="emoticonos(':mrgreen:');">
<img src="wp-includes/images/smilies/icon_neutral.gif" alt=":neutral:" onClick="emoticonos(':neutral:');">
<img src="wp-includes/images/smilies/icon_rolleyes.gif" alt=":roll:" onClick="emoticonos(':roll:');">
<img src="wp-includes/images/smilies/icon_eek.gif" alt=":shock:" onClick="emoticonos(':shock:');">
<img src="wp-includes/images/smilies/icon_confused.gif" alt=":???:" onClick="emoticonos(':???:');">
<img src="wp-includes/images/smilies/icon_cool.gif" alt=":cool:" onClick="emoticonos(':cool:');">
<img src="wp-includes/images/smilies/icon_redface.gif" alt=":oops:" onClick="emoticonos(':oops:');">
<img src="wp-includes/images/smilies/icon_twisted.gif" alt=":twisted:" onClick="emoticonos(':twisted:');">
<img src="wp-includes/images/smilies/icon_evil.gif" alt=":evil:" onClick="emoticonos(':evil:');">
<img src="wp-includes/images/smilies/icon_mad.gif" alt=":mad:" onClick="emoticonos(':mad:');">
<img src="wp-includes/images/smilies/icon_sad.gif" alt=":sad:" onClick="emoticonos(':sad:');">
<img src="wp-includes/images/smilies/icon_cry.gif" alt=":cry:" onClick="emoticonos(':cry:');">
<img src="wp-includes/images/smilies/icon_exclaim.gif" alt=":!:" onClick="emoticonos(':!:');">
<img src="wp-includes/images/smilies/icon_idea.gif" alt=":idea:" onClick="emoticonos(':idea:');">
<br />
<!-- AQUI TERMINA EL CODIGO PARA LOS EMOTICONOS WORDPRESS CON 1 CLICK -->
Cita:
Puede ser problema de mi hosting? con el javascript? oh ese codigo no es muy funcional? :smile: :grin: :razz: :lol: :wink: :mrgreen: :neutral: :roll: :shock: :oops: :twisted: :evil: :mad: :sad: :cry: :!: :idea:
Alguna otra forma para añadir a mi wordpress los iconos en el apartado comentar??
Desde ya muchas gracias y Salu2