H
hank170196
Alfa
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Problema solucionado, si alguien usa el theme novavideo puede usar este código para tener sus propias imagenes en la lista de categorías, tags o de cualquier taxonomía q quieran
captura para que vean como queda todo:
Imgur: The most awesome images on the Internet
PHP:
<?php
/**
* Template Name: Categories
*
* [MENTION=156547]pack[/MENTION]age WordPress
* @subpackage Novavideo
* @since Novavideo 1.0
*/
get_header(); ?>
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div id="page" class="post-content">
<?php the_content(); ?>
<?php
$terms = get_terms("category", $args);
$count = count($terms);
$categories = array();
if ($count > 0) {
foreach ($terms as $term) {
$args = array(
'post_type' => 'post',
'posts_per_page' => 1,
'show_count' => 1,
'orderby' => 'rand',
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => $term->slug
)
)
);
$video_from_categorie = new WP_Query( $args );
if( $video_from_categorie->have_posts() ){
$video_from_categorie->the_post();
}else{}
$term->slug;
$term->name;
?>
<?php
}
echo '</ul>';
echo '<div class="clear"></div>';
}
?>
</div><!-- #page -->
<?php endwhile; ?>
<?php endif; ?>
<ul class="listing-cat border-radius-5 box-shadow">
<li>
<img width="210" height="142" src="URL IMAGEN"></a>
<a href="URL CAT" title="TITULO CAT"><span>TITULO CAT</span></a>
</li>
</ul>
</div> <!-- #content -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
captura para que vean como queda todo:
Imgur: The most awesome images on the Internet
Última edición: