• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

sort posts by meta value

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › sort posts by meta value

This topic is: not resolved

Tagged: date, sort posts

  • This topic has 1 reply, 2 voices, and was last updated 8 years, 8 months ago by Sridhar Katakam.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 17, 2014 at 11:24 am #105635
    jamesparkin
    Participant

    I recently tried using the Post Expirator plugin which worked great. Then I tried using the follow code to sort all posts by ASC order according to the expiry date, . but this just displayed by the order which I had posted them.

  • https://gist.github.com/anonymous/242ec351bfa50ad511e2
  • But If I made a custom field called start-date and value of YYYY-MM-DD, how would I call the query in the function.php file, to display posts in order that they occur? This is in multiple categories with subcategories.

    Example: Event #1 June 01 2014
    Event #2 Dec 17 2014

    Many thanks to those who can help. Been trying to get this to work for awhile.

May 18, 2014 at 5:44 am #105719
Sridhar Katakam
Participant

Go to http://www.billerickson.net/customize-the-wordpress-query/, scroll down to "Modify Query based on Post Meta" and use that code (modify to your needs).


Genesis Tutorials | Follow me on Twitter

  • Author
    Posts
  • Viewing 2 posts - 1 through 2 (of 2 total)
    • The forum ‘General Discussion’ is closed to new topics and replies.

    CTA

    Ready to get started? Create a site or shop for themes.

    Create a site with WP EngineShop for Themes

    Footer

    StudioPress

    © 2023 WPEngine, Inc.

    Products
    • Create a Site with WP Engine
    • Shop for Themes
    • Theme Features
    • Get Started
    • Showcase
    Company
    • Brand Assets
    • Terms of Service
    • Accptable Usse Policy
    • Privacy Policy
    • Refund Policy
    • Contact Us
    Community
    • Find Developers
    • Forums
    • Facebook Group
    • #GenesisWP
    • Showcase
    Resources
    • StudioPress Blog
    • Help & Documentation
    • FAQs
    • Code Snippets
    • Affiliates
    Connect
    • StudioPress Live
    • StudioPress FM
    • Facebook
    • Twitter
    • Dribbble