[{"@context":"https:\/\/schema.org\/","@type":"BlogPosting","@id":"https:\/\/xn--adrimadiseo-beb.com\/tutoriales-wordpress\/como-separar-los-trackbacks-de-los-comentarios-en-wordpress\/#BlogPosting","mainEntityOfPage":"https:\/\/xn--adrimadiseo-beb.com\/tutoriales-wordpress\/como-separar-los-trackbacks-de-los-comentarios-en-wordpress\/","headline":"C\u00f3mo separar los trackbacks de los comentarios en WordPress","name":"C\u00f3mo separar los trackbacks de los comentarios en WordPress","description":"C\u00f3mo separar los trackbacks de los comentarios no es un truco nuevo, pero cuando WordPress lanz\u00f3 la versi\u00f3n 2.7, introdujeron un nuevo sistema de comentarios ... <a title=\"C\u00f3mo separar los trackbacks de los comentarios en WordPress\" class=\"read-more\" href=\"https:\/\/xn--adrimadiseo-beb.com\/tutoriales-wordpress\/como-separar-los-trackbacks-de-los-comentarios-en-wordpress\/\" aria-label=\"M\u00e1s en C\u00f3mo separar los trackbacks de los comentarios en WordPress\">Leer m\u00e1s<\/a>","datePublished":"2021-06-29","dateModified":"2021-06-29","author":{"@type":"Person","@id":"https:\/\/xn--adrimadiseo-beb.com\/author\/mitzamitza-es\/#Person","name":"adrimadise\u00f1o","url":"https:\/\/xn--adrimadiseo-beb.com\/author\/mitzamitza-es\/","image":{"@type":"ImageObject","@id":"https:\/\/secure.gravatar.com\/avatar\/4f04015a3698191a873267b006e8e8789ce30b6ee841a5518a6033860d50fe16?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4f04015a3698191a873267b006e8e8789ce30b6ee841a5518a6033860d50fe16?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@type":"Organization","name":"adrimadise\u00f1o.com","logo":{"@type":"ImageObject","@id":"https:\/\/xn--adrimadiseo-beb.com\/wp-content\/uploads\/2022\/05\/cropped-logo_adrima.png","url":"https:\/\/xn--adrimadiseo-beb.com\/wp-content\/uploads\/2022\/05\/cropped-logo_adrima.png","width":450,"height":90}},"image":{"@type":"ImageObject","@id":"https:\/\/xn--adrimadiseo-beb.com\/wp-content\/uploads\/2021\/06\/separatecommentandtrackback.gif","url":"https:\/\/xn--adrimadiseo-beb.com\/wp-content\/uploads\/2021\/06\/separatecommentandtrackback.gif","height":210,"width":210},"url":"https:\/\/xn--adrimadiseo-beb.com\/tutoriales-wordpress\/como-separar-los-trackbacks-de-los-comentarios-en-wordpress\/","about":["Tutoriales Wordpress"],"wordCount":837,"articleBody":"C\u00f3mo separar los trackbacks de los comentarios no es un truco nuevo, pero cuando WordPress lanz\u00f3 la versi\u00f3n 2.7, introdujeron un nuevo sistema de comentarios renovado que inclu\u00eda comentarios encadenados, capacidad de paginar y mucho m\u00e1s.  Pero junto con este cambio, tambi\u00e9n cambiaron muchos par\u00e1metros del archivo principal.  En este art\u00edculo, le mostraremos c\u00f3mo puede separar los trackbacks de los comentarios en WordPress.  Este truco solo funcionar\u00e1 para la versi\u00f3n 2.7+ y si no lo est\u00e1 utilizando, deber\u00eda comenzar ahora debido al reciente ataque de MySQL a versiones anteriores.Encontramos este tutorial en uno de los sitios web de desarrolladores de WordPress llamado Sivel.netAqu\u00ed hay un ejemplo del nuevo bucle al que nos referiremos en el tutorial:    &lt;?php if ( have_comments() ) : ?&gt;    &lt;h3 id=\"comments\"&gt;&lt;?php comments_number('No Responses', 'One Response', '% Responses' );?&gt; to %u201C&lt;?php the_title(); ?&gt;%u201D&lt;\/h3&gt;    &lt;ol class=\"commentlist\"&gt;    &lt;?php wp_list_comments(); ?&gt;    &lt;\/ol&gt;    &lt;div class=\"navigation\"&gt;    &lt;div class=\"alignleft\"&gt;&lt;?php previous_comments_link() ?&gt;&lt;\/div&gt;    &lt;div class=\"alignright\"&gt;&lt;?php next_comments_link() ?&gt;&lt;\/div&gt;    &lt;\/div&gt;    &lt;?php else : \/\/ this is displayed if there are no comments so far ?&gt;    &lt;?php if ('open' == $post-&gt;comment_status) : ?&gt;    &lt;!\u2013 If comments are open, but there are no comments. \u2013&gt;    &lt;?php else : \/\/ comments are closed ?&gt;    &lt;!\u2013 If comments are closed. \u2013&gt;    &lt;p class=\"nocomments\"&gt;Comments are closed.    &lt;?php endif; ?&gt;    &lt;?php endif; ?&gt; Encuentra este c\u00f3digo en tu comments.php:&lt;?php if ( have_comments() ) : ?&gt;Directamente debajo de este c\u00f3digo, agregue el siguiente c\u00f3digo:[\/phpOnce you have added the above code then find this code:&lt;?php wp_list_comments(); ?&gt;Replace the above code with the following code:&lt;?php wp_list_comments('type=comment'); ?&gt;Now as you see in our example loop there is a code for ordered list that looks like &lt;\/ol&gt;Directly below this code add:&lt;?php endif; ?&gt;Now by adding the endif tag, if you do not have any comments, the ordered list will not be displayed. Now lets move on to adding the pings to the comments.Add the following code below or however you want to display it. It will display the pings.    &lt;?php if ( ! empty($comments_by_type['pings'])):?>  Trackbacks \/ Pingbacks     Ahora, cuando tenga esto, mostrar\u00e1 los trackbacks pero los mostrar\u00e1 como comentarios.  Ahora es posible que desee mostrarlos como una lista porque, de lo contrario, solo est\u00e1 desperdiciando espacio.  As\u00ed que as\u00ed es como puedes hacer eso.Simplemente abrir functions.php que est\u00e1 en su carpeta de temas y agregue la siguiente funci\u00f3n all\u00ed:&lt;?phpfunction list_pings($comment, $args, $depth) {$GLOBALS['comment'] = $comment;?&gt;&lt;li id=\"comment-&lt;?php comment_ID(); ?&gt;\"&gt;&lt;?php comment_author_link(); ?&gt;&lt;?php } ?&gt; Esta funci\u00f3n le permitir\u00e1 mostrar los pings como una lista en lugar de mostrarse como un comentario.  Pero tienes que hacer una cosa m\u00e1s.Abra su comments.php y busque este c\u00f3digo:&lt;ol&gt;&lt;?php wp_list_comments('type=pings'); ?&gt; Reempl\u00e1celo con:&lt;ol&gt;&lt;?php wp_list_comments('type=pings&amp;callback=list_pings'); ?&gt;Ahora, la copia final del bucle de ejemplo se ver\u00eda as\u00ed:    &lt;?php if ( have_comments() ) : ?&gt;    &lt;?php if ( ! empty($comments_by_type['comment']) ) : ?&gt;    &lt;h3 id=\"comments\"&gt;&lt;?php comments_number('No Responses', 'One Response', '% Responses' );?&gt; to %u201C&lt;?php the_title(); ?&gt;%u201D&lt;\/h3&gt;    &lt;ol class=\"commentlist\"&gt;    &lt;?php wp_list_comments('type=comment'); ?&gt;    &lt;\/ol&gt;    &lt;?php endif; ?&gt;    &lt;?php if ( ! empty($comments_by_type['pings']) ) : ?&gt;    &lt;h3 id=\"pings\"&gt;Trackbacks\/Pingbacks&lt;\/h3&gt;    &lt;ol class=\"pinglist\"&gt;    &lt;?php wp_list_comments('type=pings&amp;callback=list_pings'); ?&gt;    &lt;\/ol&gt;    &lt;?php endif; ?&gt;    &lt;div class=\"navigation\"&gt;    &lt;div class=\"alignleft\"&gt;&lt;?php previous_comments_link() ?&gt;&lt;\/div&gt;    &lt;div class=\"alignright\"&gt;&lt;?php next_comments_link() ?&gt;&lt;\/div&gt;    &lt;\/div&gt;    &lt;?php else : \/\/ this is displayed if there are no comments so far ?&gt;    &lt;?php if ('open' == $post-&gt;comment_status) : ?&gt;    &lt;!\u2013 If comments are open, but there are no comments. \u2013&gt;    &lt;?php else : \/\/ comments are closed ?&gt;    &lt;!\u2013 If comments are closed. \u2013&gt;    &lt;p class=\"nocomments\"&gt;Comments are closed.    &lt;?php endif; ?&gt;    &lt;?php endif; ?&gt; Ahora has terminado.  Hay un truco adicional que puedes usar.  Dado que los muestra por separado, ser\u00eda bueno que mostrara el recuento de comentarios preciso excluyendo trackbacks y pings.  Utilice este tutorial que escribimos para mostrar el recuento de comentarios m\u00e1s preciso en WordPress.                                                                                                                                                                                                                                                                                                                                                                    4        \/        5        (        353                    votos                )    "},{"@context":"https:\/\/schema.org\/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Tutoriales Wordpress","item":"https:\/\/xn--adrimadiseo-beb.com\/tutoriales-wordpress\/#breadcrumbitem"},{"@type":"ListItem","position":2,"name":"C\u00f3mo separar los trackbacks de los comentarios en WordPress","item":"https:\/\/xn--adrimadiseo-beb.com\/tutoriales-wordpress\/como-separar-los-trackbacks-de-los-comentarios-en-wordpress\/#breadcrumbitem"}]}]