Duplicate Categories
-
Hi
I hope you can help me. I have installed your plugin and added my category pictures. On the front page of my site I have the lasted videos (posts) listed. I would like the category images for each post to display on the post archives on the front page.
I have added your suggested php code to loop.php to achieve this and it works okay with the exception that it is repeating the category images from the first post onto all the others.
Here is the how I included the php. I am developing locally and should have the site up in a day or so. Can you immediately see what I can do to have mutually exclusive cat images show up for each post?
Thanks
Catherine<div class=”content-container loop-container”>
<?php if ( have_posts() ) : ?>
<div class=”wrapper”>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?><article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
“><h2 class=”entry-title”><span>
<?php echo get_the_title() ? get_the_title() : __(‘Untitled’, ‘focus’) ?></span></h2>
<?php foreach (get_categories() as $cat) : ?>
<div class=cat_images>
<img src=”<?php echo z_taxonomy_image_url($cat->term_id); ?>” />
term_id); ?>”></div>
<?php endforeach; ?>
<div class=”clear”></div></article>
<?php endwhile; ?>
</div>
<?php else : ?>
<?php get_template_part( ‘no-results’, ‘index’ ); ?>
<?php endif; ?>
<div class=”clear”></div>
</div>
<?php focus_content_nav( ‘nav-below’ ); ?>
The topic ‘Duplicate Categories’ is closed to new replies.