Get Oxygen

Forums

Home Forums Feature Requests Add support for key-value style manual query in Easy Posts

This topic contains 9 replies, has 10 voices, and was last updated by  Cameron Gilroy 4 months, 3 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #46318

    Sridhar Katakam
    Participant

    At the moment, manual query can be written in Easy Posts element using query string method.

    This method is not flexible enough for many use-cases where the query parameter values need to be dynamic i.e., to a variable or function return value.

    As an example, consider the scenario where one would like to show posts that belong to the same category as the current post on a single post page while excluding the current post.

    Here's the query part for this:

    
    $categories = get_the_category();
    
    // WP_Query arguments
    $args = array(
    	'post_type' => array( 'post' ),
    	'posts_per_page' => '4',
    	'cat'	=> $categories[0]->term_id,
    	'post__not_in'	=> array( get_the_ID() ),
    );
    

    It is not possible to input this as a query string because the value of cat has to be set to a dynamic value: $categories[0]->term_id.

    There are several other such cases where this limitation prevents us from using rest of the features of Easy Posts.

    Therefore, we request you to kindly add support for key-value style array in the manual query.

    #46323

    TrustedSamurai
    Participant

    +1

    #46324

    Joe Shirley
    Participant

    Yes, please. My use case looks like this: I am using Toolset and have instances of a custom post template where each post is related by one-to-one or one-to-many relationship/association to one or more child posts. I'd love to use Easy Posts to display these child posts dynamically. Thanks for considering!

    #46445

    mediterraneo
    Participant

    Yes, please.

    #54612

    Richard FItzsimmons
    Participant

    +1 from me.
    I need to filter custom posts (events) by date, to separate out past or future events.

    #58189

    Kim Døfler
    Participant

    +1

    I also see many use cases for this feature.
    Most recently I wanted to make a list of categories and other conditions with a header and related post below.

    For example:

    "Most recent Artificial Intelligence posts"
    post 1, post 2, post 3

    "Posts about Crypto currencies read under 3 minutes"
    post 1, post 2, post 3

    "Posts similar to 'How to start your own business'"
    post 1, post 2, post 3

    etc.

    #60156

    Ladislav Jacho
    Participant

    +1, so important feature

    #62436

    David
    Participant

    +1 Would allow for related posts queries set by ACF relationships between posts (and many other use cases where we need to dynamic values in queries)

    #62464

    Daneel Minev
    Participant

    +1

    #65118

    Cameron Gilroy
    Participant

    +1

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

The forum ‘Feature Requests’ is closed to new topics and replies.

Soflyy is proud to offer you Oxygen, our vision for what visual website design can be. We love it, and we think you will too.
More About Us

Stay up to date with Oxygen

© Soflyy 2019
Designed with Oxygen.
LegalTrademark Policy
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram