I'm new to WordPress, but I spent about 50 odd hours studying it, trying to figure it out, and I feel like now I got a pretty good pen.
However, one thing that I just can't get is for the page to spit out a list of posts in a certain category.
Here is my example: http://dev.jannisgundermann.com/zoeikin/graphic-design/typographic-posters
I have a message that if I go to it, it works correctly, but does not appear on this page.
Direct post link.
The category identifier is "3" and the category name is "typographic posters."
I have a custom page template for a typographic poster page that looks like this:
<?php
?>
<?php get_header(); ?>
<?php get_sidebar(); ?>
<?php if (in_category('3')): ?>
<div class="post">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="post-description">
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
<?=get_image('flutter-image');?>
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
<?php endif; ?>
<?php get_footer(); ?>
Using this code, however, the page only shows the title, sidebar and nothing else.
If someone can help me, it really helps me figure out this wordpress category filtering.
Thanks for reading,
Jannis
source
share