I have post titles which begin with a price, eg: $199,900 – 123 Street. I am using the code below, and I’m unable to get the order by title ascending to work properly. Any suggestions please.
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'cat' =>21,
'posts_per_page' => 999999,
'paged' => $paged,
'orderby' => 'title',
'order' => 'ASC',
);
$the_query = new WP_Query($args);
?>
<div id="listings">
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()): $the_query->the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="title1 active_listing">
<?php
if (in_category('6')) {
the_title();
} else {
?>
<a href="https://wordpress.stackexchange.com/questions/30491/<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
<?php
}
?>
</div>
<div class="alignleft thumb"><?php the_post_thumbnail('thumbnail'); ?>
<br />
</div>
<div class="content"><?php the_excerpt(); ?> </div>
<?php
if (in_category('6')) {
?>
<br />
<?php
} else {
?>
<a href="https://wordpress.stackexchange.com/questions/30491/<?php the_permalink() ?>" rel="bookmark"> View Details</a>
<br />
<?php
}
?>
</div>
<?php endwhile; wp_reset_postdata();?>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php get_search_form(); ?>
<?php endif; ?>
</div>