Hallo,
Ich habe für meine Custom Post Types ein Archiv erstellt in der Form von archive-slug.php erstellt. Das Archiv wird auch wie gewünscht aufgerufen. Nur leider kann ich den Inhalt nicht Alphabetisch sortieren. Beim Googlen bin ich auf folgenden Code gestoßen:
Diesen habe ich so eingebunden:
PHP
<?php query_posts($query_string. "&order=ASC"); ?>
<?php if (have_posts()) : while (have_posts()) : the_post();
get_template_part( 'content', $theme_options['posts_length'] );
endwhile;
dynamicnews_display_pagination();
endif; ?>
Alles anzeigen
Leider werden die Einträge trotzdem nicht sortiert ausgegeben. Hat jemand eine Idee wo der Fehler liegt? Anbei noch der Inhalt der kompletten Archive Datei.
PHP
<?php get_header(); ?>
<?php // Get Theme Options from Database
$theme_options = dynamicnews_theme_options();
?>
<div id="wrap" class="container clearfix">
<section id="content" class="primary" role="main">
<h2 id="date-title" class="archive-title">
<?php // Display Archive Title
if ( is_date() ) :
printf( __( 'Monthly Archives: %s', 'dynamicnewslite' ), '<span>' . get_the_date( _x( 'F Y', 'date format of monthly archives', 'dynamicnewslite' ) ) . '</span>' );
else :
_e( 'Archives', 'dynamicnewslite' );
endif;
?>
</h2>
<?php query_posts($query_string. "&order=ASC"); ?>
<?php if (have_posts()) : while (have_posts()) : the_post();
get_template_part( 'content', $theme_options['posts_length'] );
endwhile;
dynamicnews_display_pagination();
endif; ?>
</section>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
Alles anzeigen
Danke.
Marcell