V
vicarlone
1
Sigma
Redactor
¡Excelente comerciante!
Suscripción a IA
<div class="featured">
<h2>Relacionados</h2>
<div style="padding:15px 0 15px 20px;">
<?php $recent = new WP_Query("cat=-<? echo $wt_featured; ?>&showposts=8"); while($recent->have_posts()) : $recent->the_post();?>
<div class="videopart">
<div class="thumbnail">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumb", true); ?>" width="120" height="90" alt="<?php the_title(); ?>" /></a>
</div>
<div class="fpost">
<h3><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<p><?php if(function_exists('the_views')) { the_views(); } ?></p>
<p><?php if(function_exists('the_ratings')) { the_ratings(); } ?></p>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
Exacto, eso es lo que quiero.El quiere hacerlo con ese código porque está personalizado, le muestra cosas que con un plugin no se puede hacer, a menos que lo modifiques.
Veras, el blog es este: Enlace eliminadoCon este codigo no se puede por esto
<?php $recent = new WP_Query("cat=-<? echo $wt_featured; ?>&showposts=8"); while($recent->have_posts()) : $recent->the_post();?>
talves no quieres usar plugins por la velocidad de carga son muy pesados pesados consumen recursos ancho de banda
yo desarrolle un codigo muy ligero para mostrar posts relacionados con thumbnail
pero que quieres mostrar aparte de los titulos explicate mejor asi te ayudamos
Habia pensado en ese plugin pero queria ver si era posible usando codigo =P (ademas de que no tengo mucha idea usando plantillas con el plugin xD)El código que usas no se puede usar para mostrar posts relacionados porque WP_Query no tiene un parámetro que permita hacerlo. Yo usaría Enlace eliminado que es el mejor plugin para posts relacionados que he visto en WordPress. Como puedes usar plantillas, puedes dejar el código como el que tu quieres 😉
Espero que te sea útil
<div class="featured">
<h2>Relacionados</h2>
<div style="padding:15px 0 15px 20px;">
<?php $aleatorio = get_posts('numberposts=3&orderby=rand'); foreach( $aleatorio as $post ) : ?><div class="videopart">
<div class="thumbnail">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumb", true); ?>" width="120" height="90" alt="<?php the_title(); ?>" /></a>
</div>
<div class="fpost">
<h3><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<p><?php if(function_exists('the_views')) { the_views(); } ?></p>
<p><?php if(function_exists('the_ratings')) { the_ratings(); } ?></p>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
Excelente!! Me sirvio a la perfeccion!Para post relacionados es mas programación, si quieres mostrar post aleatorios, pruebalo así, modifique tu código así que tiene la misma estructura.
PHP:<div class="featured"> <h2>Relacionados</h2> <div style="padding:15px 0 15px 20px;"> <?php $aleatorio = get_posts('numberposts=3&orderby=rand'); foreach( $aleatorio as $post ) : ?><div class="videopart"> <div class="thumbnail"> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumb", true); ?>" width="120" height="90" alt="<?php the_title(); ?>" /></a> </div> <div class="fpost"> <h3><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <p><?php if(function_exists('the_views')) { the_views(); } ?></p> <p><?php if(function_exists('the_ratings')) { the_ratings(); } ?></p> </div> </div> <?php endforeach; ?> </div> </div>
Para post relacionados es mas programación, si quieres mostrar post aleatorios, pruebalo así, modifique tu código así que tiene la misma estructura.
PHP:<div class="featured"> <h2>Relacionados</h2> <div style="padding:15px 0 15px 20px;"> <?php $aleatorio = get_posts('numberposts=3&orderby=rand'); foreach( $aleatorio as $post ) : ?><div class="videopart"> <div class="thumbnail"> <a rel="nofollow" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumb", true); ?>" width="120" height="90" alt="<?php the_title(); ?>" /></a> </div> <div class="fpost"> <h3><a rel="nofollow" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <p><?php if(function_exists('the_views')) { the_views(); } ?></p> <p><?php if(function_exists('the_ratings')) { the_ratings(); } ?></p> </div> </div> <?php endforeach; ?> </div> </div>
Para post relacionados es mas programación, si quieres mostrar post aleatorios, pruebalo así, modifique tu código así que tiene la misma estructura.
PHP:<div class="featured"> <h2>Relacionados</h2> <div style="padding:15px 0 15px 20px;"> <?php $aleatorio = get_posts('numberposts=3&orderby=rand'); foreach( $aleatorio as $post ) : ?><div class="videopart"> <div class="thumbnail"> <a rel="nofollow" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumb", true); ?>" width="120" height="90" alt="<?php the_title(); ?>" /></a> </div> <div class="fpost"> <h3><a rel="nofollow" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <p><?php if(function_exists('the_views')) { the_views(); } ?></p> <p><?php if(function_exists('the_ratings')) { the_ratings(); } ?></p> </div> </div> <?php endforeach; ?> </div> </div>
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?