Ok so I have an issue with wordpress that has been driving me mad the last few days.
I have a custom post type called "help-line" this post type then has 13 categories and some of these categories have sub categories. I also have 5 custom fields.
When I create a post under help-line I assign it to whichever category it relates to (which can be multiple)
This is where I'm getting seriously confused.
I have a page called "page-help" which is using
<?php wp_list_categories('depth=1&title_li='); ?>
to display the top level categories.
When you click on one of the categories I'm assuming it is loading category.php which has the following code to display the children of the parent category that I have just clicked on.
<?php
$categories = get_categories('hide_empty=0');
foreach ($categories as $category) :
query_posts('post_type=help-line&showposts=2&cat='.$category->cat_ID);
while(have_posts()){
the_post();
?>
<div class="height">
<div class="fourcol">
<p class="business"><?php the_field('helpline_name'); ?></p>
<p><?php the_field('helpline_address'); ?></p>
</div>
<div class="fivecol">
<p class="phone"><?php the_field('helpline_phone_number'); ?></p>
</div>
<div class="threecol last">
<ul>
<li><a href="" class="tiptip web" title="<?php the_field('helpline_name'); ?>" target="_blank"><?php the_field('helpline_name'); ?></a></li>
<li><a href="" class="tiptip comments" title="read comments from others" target="_blank"><?php the_field('helpline_comments'); ?></a></li>
<li><a href="mailto:<?php the_field('helpline_email'); ?>" class="tiptip email" title="email us your problem"><?php the_field('helpline_email'); ?></a></li>
</ul>
</div>
</div><!-- end test height -->
<?php }
endforeach; ?>
But no matter what parent category I click on it just keeps showing the same posts.
The entire thing needs to be completely dynamic show that when I add a new category it will display automatically.
Can someone please help me, I would be so greatful!!! :(
Thanks in advance.