I can't for the life of me figure out how to code this so when the single cat title pulls it's linked to that category.
This is the code which is pulling the category from the post
<h2><?php single_cat_title(); ?></h2>
I've tried everything I can think of to make that come up as a link to archive for it's particular category and nothing seems to do it. Here's the full code for what I'm working on.
<?php
$categories = get_categories('hide_empty=1');
foreach ($categories as $category) :
query_posts('showposts=3&cat='.$category->cat_ID);
if (have_posts()) : the_post();
?>
<!-- begin post -->
<div class="post">
<h2><?php single_cat_title(); ?></h2>
<div class="thumb"><a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a></div>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<a href="<?php the_permalink(); ?>" class="readmore">Play Now</a>
User Ratings -<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<!-- end post -->
<?php endif; endforeach; ?>
</div>
This is the theme I'm using, and I figured it would do this automatically, but it's not. Mega News Theme..
See how "Advertising", "Blogging", "Fashion" are showing above the individual posts...that's what I'm going for. Any ideas?
This is the code which is pulling the category from the post
<h2><?php single_cat_title(); ?></h2>
I've tried everything I can think of to make that come up as a link to archive for it's particular category and nothing seems to do it. Here's the full code for what I'm working on.
<?php
$categories = get_categories('hide_empty=1');
foreach ($categories as $category) :
query_posts('showposts=3&cat='.$category->cat_ID);
if (have_posts()) : the_post();
?>
<!-- begin post -->
<div class="post">
<h2><?php single_cat_title(); ?></h2>
<div class="thumb"><a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a></div>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<a href="<?php the_permalink(); ?>" class="readmore">Play Now</a>
User Ratings -<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div>
<!-- end post -->
<?php endif; endforeach; ?>
</div>
This is the theme I'm using, and I figured it would do this automatically, but it's not. Mega News Theme..
See how "Advertising", "Blogging", "Fashion" are showing above the individual posts...that's what I'm going for. Any ideas?