I'm trying to make a page on my WordPress website to display all kinds of food through 26 loops.
Every loop has to loop a letter of the alphabet, and on top of the page I have links that will link to the anchor boxes around the loops.
So what I want to be displayed is something like this:
NAV:
a b c d e ...(and so on) ... z
A
All items starting with the letter A
B
All items starting with the letter B
And so on..
After reading this topic: Display all posts starting with given letter? I decided to use diffrent terms for the letters.
For this I made a custom post type called 'waaier' In there I have a custom taxonomy called 'waaier_abc' And in there diffrent terms for each letter called 'waaier_a' , 'waaier_b' and so on
I think the most logical way to mage 26 loops beneath each other, because I want each letter in a diffrent div as well.
I tried this loop for it but it doesn't display anything, also not the else statement..
<div class="waaier_a_object">
<?php query_posts(array('post_type' => 'waaier', 'waaier_abc' => $term->waaier_a ) ); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, de letter a bevat nog geen inhoud.'); ?></p>
<?php endif; ?>
</div>
Does anyone have an idea for an other loop too display terms from a certain post type OR to displaying posts with a certain first letter of a certain post type.
Sorry if my english is looking weird