an update on this: I managed to change from 'orderby'=>'title' to 'orderby'=>'date'as suggested. This almost made the order perfect except one clarinet that falls out of the order and is placed in the wrong place. As far as I know understand, this could be an error in the programming since everything else works in the right order?
See: http://www.dnbe.no/ensemblet/ and second from top left: Eirik Jordal , klarinett, should be further down.
Anybody knows?
Thanks, Martin G, Norway.
The whole code:
<?php get_featured_posts('musicians'); ?>
<section id="primary">
<div id="content" role="main">
<header class="page-header">
<h2 class="page-title">Musikerne i Det Norske Blåseensemble</h2>
</header>
<div class="musicians-archive">
<?php
global $post;
$posts = get_posts(array(
'post_type'=>'dnbe_musician',
'post_status'=>'publish',
'orderby'=>'date',
'order'=>'ASC',
'numberposts'=>-1
));
if($posts){
$c = 0;
$al = count($posts);
$r = round($al / 3);
$id = 1;
foreach($posts as $post){
$post_custom = get_post_custom($post->ID);
if($c == 0){ ?>
<div class="dnbe_musician_column">
<?php
}
if($post_custom['dnbe_musician_instrument'][0] != ''){
$instrument = ', '.$post_custom['dnbe_musician_instrument'][0];
} else {
$instrument = '';
}
?>
<div class="dnbe_musician" musician_id="<?php echo $id; ?>"><h2 class="entry-title"><a href="<?php echo get_permalink($post->ID); ?>"><?php echo $post->post_title.$instrument; ?></a></h2></div>
<?php
$c++;
if($c == $r+1){
$c = 0; ?>
</div>
<?php }
?>
<?php $id++;
}
}
wp_reset_query();
?>
</div>
</div><!-- #content -->
</section><!-- #primary -->
Thanks in advance, Martin G, Norway
I¨m trying to stack the names of our musicians in the right, non-alphabetical, order on the web page. In the cms the order is right, but on the web page the names are listed alphabetically.
The homepage is made by a company, but I now try to edit some parts myself.
How do I fix this inside cms?
Check out the list here: http://www.dnbe.no/ensemblet/
The code is:
<?php get_featured_posts('musicians'); ?>
<section id="primary">
<div id="content" role="main">
<header class="page-header">
<h2 class="page-title">Musikerne i Det Norske Blåseensemble</h2>
</header>
<div class="musicians-archive">
<?php
global $post;
$posts = get_posts(array(
'post_type'=>'dnbe_musician',
'post_status'=>'publish',
'orderby'=>'title',
'order'=>'ASC',
