This should be easy but I am having such a time... probably going about it from the wrong angle. Any pointers in the right direction?
This is what I'm doing:
newsroom (category 3)
- link to fact sheet post in category 3 (specific post)
- title of subcategory
- link to post in subcategory of category 3
- link to post in subcategory of category 3
... etc
There are three subcategories to category 3 right now. I can just hard-code in the link to fact sheet.
I've got a template for category 3 but am at a loss for the code to generate the above subcategory titles and post links.
Got it. I did one of these for each area to be displayed:
<?php $posts = get_posts( "category=7" ); ?>
<?php if( $posts ) : ?>
<h2 class="lineabove">Newsletter</h2>
<?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
<p><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></p>
<?php endforeach; ?>
<?php endif; ?>
Probably there's a neater way to do this, having the h2 auto-generated to the category name. Or maybe having all of the categories on one php call, but this works just fine as long as the client doesn't change the category name.