Cómo agregar calificaciones y categorías en WordPress

  • Autor Autor pedro100
  • Fecha de inicio Fecha de inicio
P

pedro100

Zeta
Hola a tod@s.

Estoy haciendo unas pruebas en un blog de wordpress.

¿como puedo poner el Rating (estrellas) debajo de la imagen?, en el index.php tengo esto.

Insertar CODE, HTML o PHP:
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        <hr />
        <center><a href="<?php the_permalink(); ?>"><img src="<?php $values = get_post_custom_values("thumbnail"); echo $values[0]; ?>" width="150" height="200" style="margin-left:-1px;" /></a></center><?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>  
 <?php endwhile; ?>    
<div class="clear"></div>
      <center><div class="navigation box">
        <?php if(function_exists('wp_pagenavi')) wp_pagenavi(); ?>
      </div></center>
      <?php endif; ?>
      <div class="ads margin-r box">
        <?php include('ads/300x250.php'); ?>
        
      </div>

Tambien quiero que me aparezcan las CATEGORIAS en el post, pero no aparecen, en single.php tengo esto, las CATEGORIAS quiero que aparezcan a la izquierda de las estrellas de puntuacion.

HTML:
<h2><?php the_title(); ?></h2><br />
            <img class="thumbnail left" src="<?php $values = get_post_custom_values("thumbnail"); echo $values[0]; ?>" width="150" height="200" alt="" /> 
        <?php the_content('<p>Leer más &raquo;</p>'); ?>
            <div class="clear"></div>

			<?php wp_link_pages(array('before' => '<p><strong>P&aacute;ginas:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
			<?php the_tags( '<p>Tags: ', ', ', '</p>'); ?>

            <br /><br />
			<div>
            <hr />
                <p style="left; font-size: 10px;">
                  <center><?php if(function_exists('the_ratings')) { the_ratings(); } ?></center>
                  <?php if ( comments_open() && pings_open() ) { // Both Comments and Pings are open ?>
                </p>

¿como puedo poner esas dos cosas bien?

Gracias.
 
Última edición:
Hola, donde quieras que se muestren las categorías inserta esto:
Insertar CODE, HTML o PHP:
<?php the_category(', ') ?>
 
Muchas gracias sanata, he modificado un poco lo que me has dicho para que aparezca la palabra Categorías: antes de las categorias, he puesto esto y aparecen bien.

HTML:
<?php _e('Categorías: '); the_category(', ') ?>

Ahora me falta poner bien las estrellas de puntuacion en el index.php para que se vean debajo de la imagen y no sobre la imagen.

¿Alguien sabe como poner bien el Rating (estrellas)?

Gracias.
 
De nada, que plugin utilizas?
Si es el GD STAR RATING, tiene una opción que creo que es "Constructor", donde te genera el código para insertar en el template y quedaría algo así como esto...

Insertar CODE, HTML o PHP:
								<?php
				if(function_exists('wp_gdsr_render_multi')){
				//wp_gdsr_render_multi(4, 12, false, 0, 'oxygen', 20, 'oxygen_gif', 'oxygen', 20, 'oxygen_gif');
				}
				?>
 
Última edición:
De nada, que plugin utilizas?

Para las estrellas de puntuacion utilizo el plugin WP-PostRatings

Este es el codigo que tengo en el index.php

HTML:
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        <hr />
        <center><a href="<?php the_permalink(); ?>"><img src="<?php $values = get_post_custom_values("thumbnail"); echo $values[0]; ?>" width="150" height="200" style="margin-left:-1px;" /></a></center>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>  
 <?php endwhile; ?>    
<div class="clear"></div>
 
Para solucionar el tema del home donde las estrellas se superponen a la imagen habría que ver la plantilla index.php del theme, pero más o menos lo mismo que con las categorías... el trozo de código que muestra las estrellas es este:

Insertar CODE, HTML o PHP:
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>

que deberías colocarlo luego del contenedor de la imagen.

Saludos!
 
El index.php tiene esto.

<?php get_header(); ?>
<div class="contentwrapper">
<div class="wrapper">
<div class="content">
<div class="box">
<center> Publicidad 728x90 2
</center>
</div>

<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<div class="post">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<hr />
<center><a href="<?php the_permalink(); ?>"><img src="<?php $values = get_post_custom_values("thumbnail"); echo $values[0]; ?>" width="150" height="200" style="margin-left:-1px;" /></a></center>
<?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>
<?php endwhile; ?>
<div class="clear"></div>
<center><div class="navigation box">
<?php if(function_exists('wp_pagenavi')) wp_pagenavi(); ?>
</div></center>
<?php endif; ?>
<div class="ads margin-r box">
<?php include('ads/300x250.php'); ?>

</div>
<div class="ads margin-r box">
<?php include('ads/pagina-facebook.php'); ?>
</div>

<div class="ads margin-r">
<?php include('ads/pagina-facebook.php'); ?>
</div>
</div>

<?php get_sidebar(); ?>

</div>
</div>

<?php get_footer(); ?>

Lo que esta en rojo es el codigo del ratings.

¿donde lo tengo que poner para que aparezca bien?

Saludos.
 
pasate por aqui a mi me sirvio

Enlace eliminado
 
Atrás
Arriba