Ordering by meta key value
-
Im trying to get a list of pages and order them by a value in one of my meta keys. This is my code….
<?php query_posts('post_type=page&meta_key=front_page_nav&meta_value=true&orderby=&meta_key=front_page_nav_position'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li> <a href="<?php the_permalink()?>"><?php the_title()?></a> </li> <?php endwhile; endif; ?>
In the query im getting a post thats a page has a value of true in the ‘front_page_nav’ and i want to order it by another meta key called ‘front_page_nav_position’. This query works until I add the order by.
Any ideas
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Ordering by meta key value’ is closed to new replies.