Hallo,
ich möchte eine Übersichtsseite für einen meiner Custom Post Type erstellen. Hierbei möchte ich lediglich jeden Post alphabetisch Sortiert anzeigen. Die Filtereinstellungen habe ich dafür schon gefunden. Dabei möchte ich jedoch auch die Posts in das Alphabet einordnen.
Beispiel:
A
----------------------------
Amazon.de, AndererShop.de
D
---------------------------
Dieselmotor.de
S
--------------------------
Singen.de, Suppe.com
Im moment hab ich noch einen ganz einfachen Standardcode für die Übersichtsseite:
HTML
<div class="thumbnails">
<?php $args = array( 'post_type' => 'shops', 'posts_per_page' => 30, 'orderby' => 'title', 'order' => 'ASC' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>
<div class="thumbnail clearfix">
<div class="pull-left span2 clearfix" style='margin-right:10px'>
<?php the_post_thumbnail('thumbnail'); ?>
</div>
<div class="caption" class="pull-left">
<a href="<?php the_permalink(); ?>" class="btn btn-primary icon pull-right">Show Shop</a>
<?php the_title(); ?>
<?php the_content(); ?>
</div>
</div>
<?php endwhile; ?>
</div>
Alles anzeigen
Leider hab ich keine Idee wie ich die Einsortierung in das Alphabet realisieren soll. Habt Ihr vielleicht eine zündende Idee?
grüße