Como añadir los pings como si fueran comentarios

Inicio Foros WordPress Themes y Diseño Como añadir los pings como si fueran comentarios

Etiquetado: 

Este debate contiene 0 respuestas, tiene 1 mensaje y lo actualizó  imported_Paulo hace 10 años.

  • Autor
    Publicaciones
  • #11768

    imported_Paulo
    Participante

    <p>Hola, me he registrado en bitacoras, y gracias a ello, me he dado cuenta del sistema tan pésimo que tengo para administrar los pings que reciben mis entradas…</p>
    <p>Me gustaría añadir los pings, como si fueran un comentario más (como está en el blog de ayudawordpress :-))</p>
    <p>Paso el código actual, por si alguien me puede echar una mano. Gracias y un saludo!</p>
    <p>

    Code:
    <br />
    &lt;?php // Do not delete these lines<br />
    if (‘comments.php’ == basename($_SERVER[‘SCRIPT_FILENAME’]))<br />
    die (‘Por favor no cargues esta página directamente. Gracias!’);</p>
    <p> if (!empty($post-&gt;post_password)) { // if there’s a password<br />
    if ($_COOKIE[‘wp-postpass_’ . COOKIEHASH] != $post-&gt;post_password) { // and it doesn’t match the cookie<br />
    ?&gt;</p>
    <p> &lt;p class=&quot;nocomments&quot;&gt;Esta entrada esta protegida por contraseña. Ingresa la contraseña para ver los comentarios.&lt;p&gt;</p>
    <p> &lt;?php<br />
    return;<br />
    }<br />
    }</p>
    <p> /* This variable is for alternating comment background */<br />
    $oddcomment = ‘odd’;<br />
    ?&gt;</p>
    <p>&lt;!– You can start editing here. –&gt;</p>
    <p>&lt;div id=&quot;commentsbox&quot;&gt;</p>
    <p>&lt;?php if ($comments) : ?&gt;</p>
    <p>&lt;?php </p>
    <p> /* Count the totals */<br />
    $numPingBacks = 0;<br />
    $numComments = 0;</p>
    <p> /* Loop through comments to count these totals */<br />
    foreach ($comments as $comment) {<br />
    if (get_comment_type() != &quot;comment&quot;) { $numPingBacks++; }<br />
    else { $numComments++; }<br />
    }</p>
    <p>?&gt;</p>
    <p>&lt;?php </p>
    <p> /* This is a loop for printing comments */<br />
    if ($numComments != 0) : ?&gt;<br />
    &lt;h2 id=&quot;comments&quot;&gt;<br />
    &lt;?php comments_number(‘No hay Respuestas’, ‘Una Respuesta’, ‘% Respuestas’ );?&gt;<br />
    en &#8220;&lt;?php the_title(); ?&gt;&#8221;&lt;/h2&gt;</p>
    <p> &lt;ol class=&quot;commentlist&quot;&gt;<br />
    &lt;?php foreach ($comments as $comment) : ?&gt;</p>
    <p> &lt;?php if (get_comment_type()==&quot;comment&quot;) : ?&gt;</p>
    <p>&lt;li class=&quot;&lt;?php if ($comment-&gt;comment_author_email == &quot;&quot;) echo ‘mycomment’; else echo $oddcomment; ?&gt;&quot; id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt;</p>
    <p> &lt;?php sf_show_forum_avatar($comment-&gt;comment_author_email); ?&gt;</p>
    <p> &lt;p style=&quot;margin-bottom:5px; border-bottom:1px #fff dotted; padding-bottom:5px;&quot;&gt;Por <strong>&lt;?php comment_author_link() ?&gt;</strong> – <a href="&quot;&quot;#comment-&lt;?php&quot;">&quot; title=&quot;&quot;&gt;&lt;?php comment_date(‘M j, Y’) ?&gt;</a> | <a href="&quot;&quot;#respond&quot;&quot;">Responder</a>&lt;?php edit_comment_link(‘Editar’,’ | ‘,”); ?&gt;&lt;/p&gt;<br />
    &lt;?php if ($comment-&gt;comment_approved == ‘0’) : ?&gt;<br />
    <em>Tu comentario esta esperando moderación.</em><br />
    &lt;?php endif; ?&gt;<br />
    &lt;?php comment_text() ?&gt;</p>
    <p> &lt;?php /* Changes every other comment to a different class */<br />
    if (‘alt’ == $oddcomment) $oddcomment = ”;<br />
    else $oddcomment = ‘odd’;<br />
    ?&gt;</p>
    <p> &lt;?php endif; endforeach; ?&gt;</p>
    <p> &lt;?php endif; ?&gt;</p>
    <p>&lt;?php</p>
    <p> /* This is a loop for printing trackbacks if there are any */<br />
    if ($numPingBacks != 0) : ?&gt;</p>
    <p>&lt;!– &lt;ol class=&quot;tblist&quot;&gt; –&gt;</p>
    <p>&lt;div id=&quot;sidebar_info&quot;&gt;<br />
    &lt;p&gt;&lt;b&gt;Sitios que enlazan a esta entrada:&lt;/b&gt;&lt;/p&gt;</p>
    <p>&lt;?php foreach ($comments as $comment) : ?&gt;</p>
    <p>&lt;?php if (get_comment_type()!=&quot;comment&quot;) : ?&gt;</p>
    <p> &lt;li id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt;<br />
    <img src="&quot;//utilidadespc.es/wp-content/themes/o2/images/arrow_blue.jpg&quot;&lt;/img&quot;" />&lt;?php comment_author_link() ?&gt;&lt;?php comment_text() ?&gt;<br />
    &lt;?php if ($comment-&gt;comment_approved == ‘0’) : ?&gt;<br />
    <em>Tu comentario esta esperando moderación.</em><br />
    &lt;?php endif; ?&gt;</p>
    <p> &lt;?php if(‘odd’==$thiscomment) { $thiscomment = ‘even’; } else { $thiscomment = ‘odd’; } ?&gt;</p>
    <p>&lt;?php endif; endforeach; ?&gt;</p>
    <p>&lt;!– –&gt;</p>
    <p>&lt;/div&gt;</p>
    <p>&lt;?php endif; ?&gt;</p>
    <p>&lt;?php else : </p>
    <p> /* No comments at all means a simple message instead */<br />
    ?&gt;</p>
    <p>&lt;?php endif; ?&gt;</p>
    <p>&lt;?php if (comments_open()) : ?&gt;</p>
    <p> &lt;?php if (get_option(‘comment_registration’) &amp;&amp; !$user_ID ) : ?&gt;<br />
    &lt;p id=&quot;comments-blocked&quot;&gt;Debes <a href="&quot;&quot;&lt;?php&quot;">/wp-login.php?redirect_to=<br />
    &lt;?php the_permalink(); ?&gt;&quot;&gt;ingresar</a> para publicar un comentario.&lt;/p&gt;<br />
    &lt;?php else : ?&gt;</p>
    <p> &lt;form action=&quot;&lt;?php echo get_option(‘siteurl’); ?&gt;/wp-comments-post.php&quot; method=&quot;post&quot; id=&quot;commentform&quot;&gt;</p>
    <p> &lt;h2&gt;Deja un Comentario&lt;/h2&gt;</p>
    <p> &lt;?php if ($user_ID) : ?&gt;</p>
    <p> &lt;p&gt;Has ingresado como <a href="&quot;&quot;&lt;?php&quot;">/wp-admin/profile.php&quot;&gt;<br />
    &lt;?php echo $user_identity; ?&gt;</a>. Para salir, <a href="&quot;&quot;&lt;?php&quot;">/wp-login.php?action=logout&quot; title=&quot;Salir de esta cuenta&quot;&gt;haz clic aquí</a>.<br />
    &lt;/p&gt;</p>
    <p>&lt;?php else : ?&gt; </p>
    <p> &lt;p&gt;&lt;label for=&quot;author&quot;&gt;Nombre&lt;?php if ($req) _e(‘ (requerido)’); ?&gt;&lt;/label&gt;<br />
    &lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;&lt;?php echo $comment_author; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;1&quot; /&gt;&lt;/p&gt;</p>
    <p> &lt;p&gt;&lt;label for=&quot;email&quot;&gt;Email (no será publicado)&lt;?php if ($req) _e(‘ (requerido)’); ?&gt;&lt;/label&gt;<br />
    &lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;&lt;?php echo $comment_author_email; ?&gt;&quot; tabindex=&quot;2&quot; size=&quot;22&quot; /&gt;&lt;/p&gt; </p>
    <p> &lt;?php<br />
    /****** Math Comment Spam Protection Plugin ******/<br />
    if ( function_exists(‘math_comment_spam_protection’) ) {<br />
    $mcsp_info = math_comment_spam_protection();<br />
    ?&gt; &lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;mcspvalue&quot; id=&quot;mcspvalue&quot; value=&quot;&quot; size=&quot;22&quot; tabindex=&quot;4&quot; /&gt;<br />
    &lt;label for=&quot;mcspvalue&quot;&gt;&lt;small&gt;Protección de Spam: El resultado de &lt;?php echo $mcsp_info[‘operand1’] . ‘ + ‘ . $mcsp_info[‘operand2’] . ‘ ?’ ?&gt;&lt;/small&gt;&lt;/label&gt;<br />
    &lt;input type=&quot;hidden&quot; name=&quot;mcspinfo&quot; value=&quot;&lt;?php echo $mcsp_info[‘result’]; ?&gt;&quot; /&gt;<br />
    &lt;/p&gt;<br />
    &lt;?php } // if function_exists… ?&gt;<br />
    &lt;?php endif; ?&gt;</p>
    <p> &lt;p&gt;&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;5&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;&lt;/p&gt;</p>
    <p> &lt;p&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; tabindex=&quot;5&quot; value=&quot;Envía tu Comentario&quot; /&gt;<br />
    &lt;input type=&quot;hidden&quot; name=&quot;comment_post_ID&quot; value=&quot;&lt;?php echo $id; ?&gt;&quot; /&gt;&lt;/p&gt;</p>
    <p> &lt;?php do_action(‘comment_form’, $post-&gt;ID); ?&gt;</p>
    <p> &lt;/form&gt;</p>
    <p>&lt;?php endif; // If registration required and not logged in ?&gt;</p>
    <p>&lt;?php else : // Comments are closed<br />

    </p>

El foro ‘Themes y Diseño’ está cerrado y no se permiten nuevos debates ni respuestas.

Pin It on Pinterest

Ir al contenido