This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Custom query string

  • Creator
    Topic
  • #1627
    odyn
    Participant

    The problem I’m trying to solve is having two post grids, one showing future events while the other would be showing events that are already in progress, both sorted by date.
    Anyway.
    I spotted a custom query string argument in post grid function (without a gui complement). I guess that would be the most painless way to go. Will it require an entire query string or will it just add the query part to the rest of arguments? In my advanced-user-but-not-really-a-progammer world that would be much more user friendly. Do you have some plans to implement that in gui?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #1637
    Jason Bobich
    Keymaster

    Hello,

    You can implement custom queries from your WordPress admin already. There are essentially three different ways of using a post grid, and here are all the ways you’d implement the custom query.

    • Post Grid elements of Layout Builder — There is actually an option called “Custom Query” you can use. Should be fairly obvious on this one. Let me know if you can’t find it and I’ll post a screenshot.
    • Post Grid page template — Add a custom field called “query”
    • Post Grid shortcode — Add the parameter “query” to the shortcode.
      Ex: [post_grid query=”tag=whatever&cat=1″]
    #1763
    odyn
    Participant

    Shortcode did the trick, thank you. Now I can have post grids showing future events and events in duration without any plugins or hacking. Great.
    Did you consider for the custom query in the builder to just add to the query and not entirely override the rest of the fields it gets from gui?

    #1766
    Jason Bobich
    Keymaster

    Did you consider for the custom query in the builder to just add to the query and not entirely override the rest of the fields it gets from gui?

    Yes, but this allows the user to do conflicting things and there will be other problems for those that do know what they’re doing with the query string. If you’re using the custom query string, you should be on top of what you’re doing and so I want to make sure you have total control.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.