• 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

Converting working Logic to Meta query

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 › Converting working Logic to Meta query

This topic is: resolved

Tagged: WP_query

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 11 months ago by Susan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • December 28, 2013 at 6:15 am #81543
    vajrasar
    Member

    We are using Post as the event listing and has included two custom taxonomies of 'event start date' and 'event end date'. The custom taxonomies are being saved in database as unix timestamps.

    On the archives, we are showing Events that are either currently running, or scheduled in future or has end date of today.

    As implied, we used a logic to compare 'start date' and 'end date' from 'today date' (current date).

    The logic is (line 45-46) :-

    The problem is, we are using this logic in the loop to show posts, so actually database query loads all the posts and then we filter the events to be shown and display them.

    This seems wrong because query has to do all the work to load 100 posts (for example) whereas only 50 posts are eligible to be shown (because other 50 are the events that were scheduled in past).

    So, can you suggest any way with which we can implement our working logic in wordpress query (meta query) so that only the eligible posts get fetched instead of all posts.


    I make WordPress websites using Genesis Framework.

    WordPress/Genesis Development | Customizations

    http://localhost
    February 21, 2014 at 9:50 am #91646
    Susan
    Moderator
    This reply has been marked as private.
  • 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

© 2026 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