Links to categories not working
-
Hi Does anyone have an idea why the ‘read more’ and h1 links to the children categories on this page aren’t linking correctly? ‘Intruder Alarms’ it links to here and not here for example. Here’s the code:
<?php $current = get_the_category(); $current_id= $current[0] ->cat_ID; $categs_list = get_category_parents($current_id); $pieces = explode("/", $categs_list); $parent_name = $pieces[0]; $parent_id = get_cat_id($pieces[0]); ?> <div id="innerTop"> <div class="innerTitle clearfix"><?php echo $parent_name; ?></div> <?php if(category_description($parent_id) !=''){?> <!--<div class="innerDesc"><?php echo category_description($parent_id);?> </div>--> <?php }?> </div> <div class="breadcrumb"> <?php if(function_exists('bcn_display')) { bcn_display(); } ?> </div> <!-- begin colLeft --> <div id="colLeft"> <div id="archive-title"> <h1><?php $current_category = single_cat_title("", true); ?></h1> <div class="catdesc"><?php echo category_description( $category ); ?></div> </div> <!--these don't link correctly--> <?php query_posts('cat=5');?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="boxgrid thecombo"> <h1><a href="<?php the_permalink() ?>"> <?php the_title(); ?> </a></h1> <img src="<?php if ( function_exists('p75GetThumbnail') )echo p75GetThumbnail($post->ID); ?>" alt="<?php the_title(); ?>" /> <?php the_excerpt(); ?> <p><a href="<?php the_permalink() ?>">Read more »</a></p> </div> <?php endwhile; ?> <!-- <div class="navigation"> <div class="alignleft"><?php next_posts_link('Older') ?></div> <div class="alignright"><?php previous_posts_link('Newer') ?></div> </div> --> <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> <?php else : ?> <p>Sorry, but you are looking for something that isn't here.</p> <?php endif; ?> </div> <!-- end colLeft --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Links to categories not working’ is closed to new replies.