WP Residence Help WP Residence Help

  • WpEstate
  • Video Tutorials
  • CLIENT SUPPORT
Home / Technical how to | Custom Code Required, Technical: Custom Order / Order by EDIT DATE

Order by EDIT DATE

In wordpress there are 2 order situations by date:

– first publish date

– edit publish date

We use order by first publish date and edit date is not considered.

So default order will consider the first publish date.

The technical solution is to modify the query orderby, but it’s sensitive when working with custom order as well, so it cannot be added to core at this moment.

But if you wish, we can guide you to look for the following function that controls this custom query – wpestate_my_order and then modify it according to WordPress query rules – http://codex.wordpress.org/Class_Reference/WP_Query

What you need is

orderby (string | array)

  • ‘modified‘ – Order by last modified date.

—

—
Query is set in WP Residence in help_functions.php

/////////////////////////////////////////////////////////////////////////////////
// order by filter featured
///////////////////////////////////////////////////////////////////////////////////

if( !function_exists('wpestate_my_order') ):
function wpestate_my_order($orderby) { 
global $wpdb; 
global $table_prefix;
$orderby = $table_prefix.'postmeta.meta_value DESC, '.$table_prefix.'posts.ID DESC';
return $orderby;
} 

endif; // end wpestate_my_order

—

It is possible to add ORDER by modified, by but you need to do code changes in a lot of places . If you are not skilled at coding you should hire someone since a bad code added on this area can have major impact.
You have to add new order by way
should by ‘order_by’ =>’modified’
For ex in property_list.php you have this switch/ case code http://prntscr.com/gl1sff .
You should add a new branch that look like
   case 10:
                    $meta_order=”;
                    $meta_directions=’DESC’;
                    $order_by=’modified’;
                    break;
Technical how to | Custom Code RequiredTechnical: Custom Order

Related Articles

  • Technical: How to change default sidebar position for a new page
  • How to remove “Delete Property” from Dashboard -> Actions
  • How to hide Agency and Developer City and Area
  • Technical: Hide a specific tab in property page (default template)

WP Residence Documentation

  • 1. General
    • Get Support
    • Get your buyer license code
    • Use SSL / https
    • Server / Theme Requirements
  • 2. Installation
  • 3. Installation FAQ
  • 4. Advanced Search
    • Advanced Search Colors
    • Search Theme Options
    • Geolocation Search for Half Map
    • Advanced Search Form
    • Advanced Search Settings
  • 5. Agent, Agency & Developers
  • 6. Property Page
  • 7. Properties List
  • 8. Property Taxonomies
  • 9. Property Custom Template
  • 10. Blog Posts & Blog List
  • 11. Shortcodes
    • Contact Form
    • Featured Agency/Developer
    • Membership Packages
    • Testimonials
    • Google Map with Property Marker
    • Listings per Agent, Agency or Developer
    • Display Categories
    • Agent List
    • Recent Items Slider
    • Recent items
    • List properties or articles by specific ID
    • Featured Agent
    • Featured Article
    • Featured Property
    • Login & Register Form
    • Property Page Custom Template Shortcodes
    • How to add the background for a row
    • Font awesome
    • Icon Content Box Shortcode
    • Shortcodes and Widgets IDs
  • 12. Widgets
  • Theme Options
    • General Theme Options
      • General Settings
      • User Types Settings
      • Appearance
      • Logos & Favicon
      • Header
      • General Theme Settings – Footer Style and Colors
      • Price & Currency
      • Property Custom Fields
      • Features & Amenities
      • Listing Labels. Property Status.
      • Theme Slider
      • Permalinks
      • Splash Page
    • Social & Contact Theme Settings
    • Map Settings
      • Map Settings
      • Pin Management
      • How read from file works
    • Design Settings
      • General Design Settings
      • Print PDF Design
      • Custom Colors Settings
      • Header Design & Colors
      • Mobile Menu Colors
      • Property, Agent, Blog Lists Design Settings
      • Sidebar Widget Design
      • User Dashboard Design
      • Font management
      • How to add custom CSS
      • Custom Property Card Unit – Beta version
    • Advanced Settings
      • Email Management
      • Import & Export theme options
      • reCaptcha settings
      • YELP API Integration
      • iHomefinder Optima Express IDX
    • Membership Settings
      • MEMBERSHIP & PAYMENT Settings
      • Property Submission Page
      • PAYPAL SET-UP
      • STRIPE SET-UP
      • Wire Transfer Payment Method
  • Translation
  • FAQ
  • Pages
  • Header
  • Footer
  • Google or Open Street Maps
  • Payment Options
  • Plugins
    • Included Plugins
    • Third Party Plugins – IDX Compatibility
    • Third Party Plugins – Multi Languages
    • Third party Plugins – Other
  • Technical
    • Technical how to | Custom Code Required
    • Technical: Child Theme
  • Theme Updates

Join Us On

Follow Us : Powered by WordPress and WP Estate-All Rights Reserved

  • WpEstate
  • Video Tutorials
  • CLIENT SUPPORT