Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author agentevolution

    (@agentevolution)

    No there isn’t at this time. Prices would need to be cleaned (removing commas, dollar signs, etc) in order to be sorted.

    You can change the order by editing each listing and changing the publish date. You can coordinate with with your listing prices. Shouldn’t take you too long.

    You seriously can’t sort by price (or square foot)? That’s a basic feature of any real estate listing. Changing publishing date would be a very tedious way of accomplishing this.

    yaderhey

    Rather than providing sharp complaints to the author, why not contribute and help find a solution. The author has given this plugin to you for free.

    I just spent 3 minutes installing and testing the following plugin, and it works perfect and allows you to drag sort your listings. https://wordpress.org/plugins/post-types-order

    Plugin Author agentevolution

    (@agentevolution)

    This is a premium plugin but looks like it will let you do what you want – http://codecanyon.net/item/wordpress-meta-data-taxonomies-filter/7002700

    Have a look at their demo for real estate – http://demo2.wordpress-filter.com/category/real-estate-posts/

    Hi Strid3r
    i installed the plugin you mentioned but it hide some informations in the archive page. Did you haver the same problem?

    Thank you

    No I did not. There are a few other ORDERING plugins that you can try. OR, if you havea small amount of listings, you can always just edit the publish date, which really does not take that long.

    I just achieved this by modifying archive-listing.php. It doesn’t work with pagination though!

    You do have to know a bit of php, but here is the gist:

    In the function archive_listing_loop(), I moved everything that was in the while(have_posts()) loop out of it, so that it was empty. I then took that code and wrapped it in this foreach:

    foreach($listingsArray as $listing){
       //old code in the have posts loop goes here, below the have posts loop endwhile.
    }

    Then, I put this code inside the while have_posts() loop:

    $strippedPrice = preg_replace("/[^0-9.]/","",get_post_meta( $post->ID, '_listing_price', true ));
    
    			$listingsArray[$strippedPrice] = array(
    				'permalink'=> get_permalink(),
    				'thumbnail'=> get_the_post_thumbnail( $post->ID, 'listings' ),
    				'status' => wp_listings_get_status(),
    				'price' => get_post_meta( $post->ID, '_listing_price', true ),
    				'title' => get_the_title(),
    				'address' => wp_listings_get_address(),
    				'city' => wp_listings_get_city(),
    				'state' => wp_listings_get_state(),
    				'zip' => get_post_meta( $post->ID, '_listing_zip', true ),
    				'bedrooms' => get_post_meta( $post->ID, '_listing_bedrooms', true ),
    				'bathrooms' => get_post_meta( $post->ID, '_listing_bathrooms', true ),
    				'sqft' => get_post_meta( $post->ID, '_listing_sqft', true ),
    				'id' => get_the_id()
    			);

    Then, after the endwhile, I sorted the array:
    ksort($listingsArray);

    Now back down in our new foreach loop, I replaced all the instances of (for example) get_the_post_thumbnail( $post->ID, ‘listings’ ) with $listing[‘thumbnail’] etc, as you can see in the array above.

    This might be a bit tricky for some people, but just FYI, it is totally doable!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Change the order of listings on the listings page’ is closed to new replies.