Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

Ver comentarios en página inicial

Estas en el tema de Ver comentarios en página inicial en el foro de WordPress en Foros del Web. Hola a todos... Quisiera hacer esto en la home de WordPress: _________________________________________ TITULO Fecha Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto ...
  #1 (permalink)  
Antiguo 25/05/2008, 20:14
Avatar de axe
axe
 
Fecha de Ingreso: marzo-2004
Ubicación: Capitán Bermúdez, Santa Fe, Argentina
Mensajes: 180
Antigüedad: 20 años, 1 mes
Puntos: 1
Ver comentarios en página inicial

Hola a todos...
Quisiera hacer esto en la home de WordPress:
_________________________________________

TITULO
Fecha

Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto Texto .

Comentario 1
bla bla bla

Comentario 2

bla bla bla

Comentario 3
bla bla bla
_________________________________________

O sea, que lo comments se vean de arranque, sin tener que clickear el titulo. Sería como tienen los fotologs.

Graciasss
__________________
Esteban | RomeroSitios.com
Diseño Web Rosario < conocenos!
  #2 (permalink)  
Antiguo 27/05/2008, 03:01
Avatar de David_dfd  
Fecha de Ingreso: febrero-2005
Ubicación: Tenerife
Mensajes: 311
Antigüedad: 19 años, 2 meses
Puntos: 2
Respuesta: Ver comentarios en página inicial

Es bastante sencillo solo tienes que usar el codigo que incluye los comentarios igual que en la pagina Entrada Individual (single.php) (Depende de tu Themes)

La pagina single.php será algo parecido a esto:

Código PHP:
<?php get_header(); ?>

<div id="content"> 



    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                <div class="entry">
                <div id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Enlace permanente <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                <div class="postinfo">
                <h4>Enviado por: <?php the_author(', '?> </h4> <h5><?php the_time('F j, Y'); ?></h5>
                </div>
                <?php the_content('Leer toda la noticia &raquo;'); ?>
                <div class="postbot">                
                <h4><?php the_category(', '?></h4> 
                </div>
                </div></div>

<div class="entry">
    <?php comments_template(); ?>
    </div>

    <?php endwhile; else: ?>
<div class="entry">
        <p>Sorry, no posts matched your criteria.</p>
</div>
<?php endif; ?>

    </div>
<?php get_sidebar(); ?>
<?php get_footer
(); ?>
Aunque solo nos interesa esto:

Código PHP:
<div class="entry">
    <?php comments_template(); ?>
    </div>

Luego vas a editar la pagina principal de tu themes que será index.php que sera algo parecido a esta:

Código PHP:
<?php get_header(); ?>

    <div id="content">



    <?php if (have_posts()) : ?>

        <?php while (have_posts()) : the_post(); ?>
<div class="entry">
            <div id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Enlace <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                <div class="postinfo">
                <h4>Enviado por: <?php the_author(', '?> </h4> <h5><?php the_time('F j, Y'); ?></h5>
                </div>
                <?php the_content('Leer toda la noticia &raquo;'); ?>
                <div class="postbot">                
                <h4><?php the_category(', '?></h4> <h5><?php comments_popup_link('Deja tu comentario''1 Comentario''% Comentarios'); ?></h5>
                </div>
                </div></div>


        <?php endwhile; ?>

        <div class="navigation">
            <p><?php next_posts_link('« Noticias Anteriores'?>
            <?php previous_posts_link('| Siguientes Noticias » '?></p>
        </div>

    <?php else : ?>
<div class="entry">
        <h2>Not Found</h2>
        Sorry, but you are looking for something that isn't here.
</div>

    <?php endif; ?>
</div>
    

<?php get_sidebar(); ?>

<?php get_footer(); ?>
Como vez aqui no se muestra la parte:

Código PHP:
<div class="entry">
    <?php comments_template(); ?>
    </div>
Asi que solo tenemos que añadirla a index.php para que se muestren en la pagina principal.

Código PHP:
<?php get_header(); ?>

    <div id="content">



    <?php if (have_posts()) : ?>

        <?php while (have_posts()) : the_post(); ?>
<div class="entry">
            <div id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Enlace <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                <div class="postinfo">
                <h4>Enviado por: <?php the_author(', '?> </h4> <h5><?php the_time('F j, Y'); ?></h5>
                </div>
                <?php the_content('Leer toda la noticia &raquo;'); ?>
                <div class="postbot">                
                <h4><?php the_category(', '?></h4> <h5><?php comments_popup_link('Deja tu comentario''1 Comentario''% Comentarios'); ?></h5>
                </div>
                </div></div>
    <div class="entry">
    <?php comments_template(); ?>
    </div>

        <?php endwhile; ?>

        <div class="navigation">
            <p><?php next_posts_link('« Noticias Anteriores'?>
            <?php previous_posts_link('| Siguientes Noticias » '?></p>
        </div>

    <?php else : ?>
<div class="entry">
        <h2>Not Found</h2>
        Sorry, but you are looking for something that isn't here.
</div>

    <?php endif; ?>
</div>
    

<?php get_sidebar(); ?>

<?php get_footer(); ?>
Luego solo debes adaptar el comments.php para dejarlo a tu gusto.

Repito que no tiene por que ser exactamente igual, depende mucho de la plantilla, pero el codigo se ha de parecer al menos.
  #3 (permalink)  
Antiguo 27/05/2008, 09:20
Avatar de axe
axe
 
Fecha de Ingreso: marzo-2004
Ubicación: Capitán Bermúdez, Santa Fe, Argentina
Mensajes: 180
Antigüedad: 20 años, 1 mes
Puntos: 1
Respuesta: Ver comentarios en página inicial

Ok, muchas gracias.
Pruebo y aviso... Saludos.
__________________
Esteban | RomeroSitios.com
Diseño Web Rosario < conocenos!
  #4 (permalink)  
Antiguo 28/05/2008, 17:32
Avatar de axe
axe
 
Fecha de Ingreso: marzo-2004
Ubicación: Capitán Bermúdez, Santa Fe, Argentina
Mensajes: 180
Antigüedad: 20 años, 1 mes
Puntos: 1
Respuesta: Ver comentarios en página inicial

David, gracias por tu respuesta. Probé y probé, rompí todo varias veces, por suerte tengo backup. La verdad que no lo sé hacer, no sé nada de PHP.
No es de vago, pero si me podés ayudar te lo agradecería mucho.

Mi single.php es este:
Código PHP:
<?php get_header(); ?>

<div class="main">

    <div class="col2">

        <div class="left">

            <div class="content">
    
    <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
            <div class="post" id="post-<?php the_ID(); ?>">

                <h1><?php the_title(); ?></h1>
                    
                <div class="descr"><?php the_time('F jS, Y'?> by <?php the_author() ?><?php edit_post_link('Editar',' ~ ',''); ?></div>

                <div class="entry">

                    <?php the_content('Read the rest of this entry &raquo;'); ?>

                </div>

                <p class="info">Publicado en <?php the_category(', '?></p>

            </div>

            <?php comments_template(); ?>

        <?php endwhile; ?>

            <p align="center"><?php next_posts_link('&laquo; Noticias Anteriores'?> <?php previous_posts_link('Noticias Siguientes &raquo;'?></p>

    <?php else : ?>

            <h1>No encontrado</h1>

            <p>Lo que buscas no está por estos pagos...</p>

    <?php endif; ?>
        
        </div>

    </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
Y index.php

Código PHP:
<?php get_header(); ?>

<div class="main">

    <div class="col2">

        <div class="left">

            <div class="content">
    
    <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
            <div class="post" id="post-<?php the_ID(); ?>">

                <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
                    
                <div class="descr"><?php the_time('F jS, Y'?> by <?php the_author() ?><?php edit_post_link('Editar',' ~ ',''); ?></div>

                <div class="entry">

                    <?php the_content('Leer más &raquo;'); ?>

                </div>

                <p class="info">Publicado en <?php the_category(', '?> con <?php comments_popup_link('sin comentarios &raquo;''1 comentario &raquo;''% comentarios &raquo;'); ?></p>

        </div>

            



<?php comments_template(); ?>

        <?php endwhile; ?>

            <div class="left"><?php next_posts_link('&laquo; Noticia Anterior'?></div>
            <div class="right"><?php previous_posts_link('Noticias Siguiente &raquo;'?></div>
            <div class="clearer"></div>

    <?php else : ?>

            <h2 align="center">No encontrado</h2>

            <p align="center">Lo que buscas no está por estos pagos....</p>

    <?php endif; ?>

            </div>

        </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>
__________________
Esteban | RomeroSitios.com
Diseño Web Rosario < conocenos!

Última edición por axe; 29/05/2008 a las 13:15
  #5 (permalink)  
Antiguo 01/06/2008, 16:06
Avatar de axe
axe
 
Fecha de Ingreso: marzo-2004
Ubicación: Capitán Bermúdez, Santa Fe, Argentina
Mensajes: 180
Antigüedad: 20 años, 1 mes
Puntos: 1
Respuesta: Ver comentarios en página inicial

Hola... algún colaborador?
__________________
Esteban | RomeroSitios.com
Diseño Web Rosario < conocenos!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:45.