Sort by Date

This topic contains 8 replies, has 2 voices, and was last updated by  Scott Robins 4 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #507637

    Scott Robins
    Free User
    Post count: 100

    Hi Folks

    We would like to create a page and list the 20 latest listings added to the directory. Can you tell me the easiest / best way to do this.

    Thanks

    Scott

    #507675

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    Here is one way to do that with GD Listings

    1. Go to the CPT settings for the CPT – Places – Settings – Sorting (tab)

    2. Go to the Sorting tab

    3. Find “Add Date” and click on it, so it reappears on the right side

    4. Rename that to “Latest” and set sort order for descending and save

    5. Add a new GD Listing shortcode to a new page. In the sorting options select “Latest”

    6. Set the other options as required and save

    Let us know how it goes

    https://wpgeodirectory.com/docs-v2/places/sorting/

    #507756

    Scott Robins
    Free User
    Post count: 100

    Hi Folks

    So just to confirm, doing this will only affect the sort order on this one page, and not the sort order on the rest of the website ?

    Many thanks

    Scott

    #507792

    Alex Rollin
    Moderator
    Post count: 27815

    It will add an option to the CPTs sorting option in gd_loop_actions so end users can access the sort on any archive of that CPT.

    If you make it default then it will be the default sort.

    #507799

    Scott Robins
    Free User
    Post count: 100

    We want to have a SINGLE page with LATEST listings.

    I believe this is how the [gd_popular_post_view] used to work.

    That would change it for everything. We do not want every page on the entire site to be sorted by date, we have featured and package-led listings that are listed first.

    #507803

    Alex Rollin
    Moderator
    Post count: 27815

    Do you use gd_loop_actions? If not, then it will not change anything except make a custom sort available for configuration in a GD Listings shortcode.

    Without adjusting sort options, try adding this to your GD Listings shortcode

    
    
    
    sort_by="post_date_desc"
    

    Be sure to remove any other sort_by option you have there.

    #507838

    Scott Robins
    Free User
    Post count: 100

    How would we use this on a page?

    I’ve created
    https://dev.shoppingonline.ie/latest-shops/

    With these contents:
    [gd_loop_actions sort_by=”post_date_desc”]
    [gd_loop layout=0]
    [gd_loop_paging]

    However it says “No listings found that match your selection.” because this is a search.

    We simply want a page that shows the latest listings.

    #507868

    Alex Rollin
    Moderator
    Post count: 27815

    Use GD Listings. GD Loop is only for archive page templates.

    
    
    
    [gd_listings post_type="gd_place" sort_by="post_date_desc" title_tag="h3" layout="4" post_limit="20"]
    
    #508007

    Scott Robins
    Free User
    Post count: 100

    thanks Alex, that worked 🙂

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket