Dead Simple Way to Exclude Items From Query Loops in Bricks Builder (Meta Queries!)

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • ALERT: This is an important training. You may want to set ALL your loops up like this from the very start of every project. You might even want to make it part of your development blueprint!
    There's a common challenge that you'll run into when using query loops: How can you exclude specific items from being shown but the loop when needed?
    Bricks has a default control for this, but that's NOT the solution I recommend because it has scalability, maintainability, and general "hassle" issues (I'll demonstrate in this video).
    The real solution involves another Bricks query loop feature that you might not be aware of or know how to use yet: meta queries.
    Don't worry, it's EASY, and I'll walk you through it step by step. This solution gives you tremendous control over item visibility across your entire website.
    While I used Advanced Custom Fields for this (geni.us/YYhEP), you can use Metabox (geni.us/t3UBIYH) as well.
    ** MY TOOLS **
    🔥 AutomaticCSS (ACSS) - automaticcss.com
    🔥 Frames - getframes.io
    See all my recommended tools here: geary.co/tools/
    ** INNER CIRCLE **
    Step your design/dev game up, make more money, and get the full scoop on scaling your digital agency! When it comes to the Inner Circle, I don't hold back.
    ⭕ In-depth design & dev trainings
    ⭕ Business, sales, & marketing trainings
    ⭕ Agency resources & downloadables
    ⭕ Vibrant, quality community with zero toxicity
    ⭕ ...and much more!
    Learn more and join here: geary.co/inner...
    ** SOCIAL **
    👉 FB - / marketingkev
    👉 LinkedIn - / kevingeary
    ** CHAPTERS **

Комментарии • 103

  • @RobCooper
    @RobCooper Месяц назад

    OH BRILLIANT! a custom field group for "visibility" alone. Before starting with Bricks, ACSS, Frames and ACF (actual hands on), I watched and learned. I got to know what was possible, knowing I could come back and get the details on how. This allowed me to design the structure and functionality ahead of time, knowing X was possible. Now that I'm 2 weeks into the new software, I'm back to add the functionality. It's been a fascinating 2 weeks now that I'm hands on.

  • @mr.matt.eastwood
    @mr.matt.eastwood 7 месяцев назад +9

    Yes! Another gold nugget. Makes me wonder whether you'd consider making a video explaining how meta queries work in general? It's one aspect of query loops that I still struggle with. I feel like I'm getting the basic idea, but I haven't yet wrapped my head around the whole picture. Would love a tutorial.

    • @kristapsvilcans
      @kristapsvilcans 7 месяцев назад +2

      I would also love to see Kevin's video on Query loop, Taxonomy query and Meta query, proper use of Custom fields and post types. When to use it, in what cases not to use it, because I think that I am trying to use query loop everywhere now, which ends up being too complicated, because there are too many post types and perhaps it is wrong because You can't find what You want to change/add new stuff/take off.

    • @sophiemulders
      @sophiemulders 6 месяцев назад

      I did not know what meta query was until he showed me here.

  • @old_ogcdigital
    @old_ogcdigital 7 месяцев назад +6

    Saving queries similarly to classes would be a fantastic addition!

    • @WolfStackAUS
      @WolfStackAUS 7 месяцев назад +1

      JetEngine does this with the query builder 👌👍
      Edit: you can just reference the query from the Bricks query builder. Super useful

    • @old_ogcdigital
      @old_ogcdigital 7 месяцев назад +1

      @@WolfStackAUS Yeah, but... crocoblock.

    • @iservisat
      @iservisat 6 месяцев назад

      Look up Advanced Themer, it has and its amazing

  • @stevebaker2896
    @stevebaker2896 7 месяцев назад +6

    Good stuff but... is it not better to have the loop control as a custom taxonomy rather than a custom field? Querying by custom fields is not as performant as querying by taxonomy. And 'Don't show in Loops' definitely seems like a 'category' type thing (that multiple posts might belong to) rather than a custom field that is best used for displaying unique information. Querying by taxonomy makes for a faster site when you are dealing with lots of posts. A single term taxonomy can be queried super fast as you don't even need to check against a specific term, you can just check whether the post contains data (any data) for that taxonomy or if it's empty.

    • @Gearyco
      @Gearyco  7 месяцев назад +2

      I don’t see it as a taxonomy. Not worried about performance unless it’s hundreds or thousands of items. This is a few items here and there - not used heavily.

  • @MicahChoquette
    @MicahChoquette 7 месяцев назад

    This is mind-blowing. I'm not new to WP but still new to Bricks. Everytime I watch something lately, it proves I made the right move by making the switch.

  • @geremaurer1506
    @geremaurer1506 5 месяцев назад

    I love working with CPT's and making it easier for customers. As of today, this step is also part of it.
    Thank you very much.

  • @lmsbolt
    @lmsbolt 6 месяцев назад

    This has opened my mind to countless possibilities of where to implement this behavior...thank you sir!

  • @justinsideris
    @justinsideris 7 месяцев назад

    Did my own version of this about a week ago, but I like your Meta queries explanation. I also think someone did a feature request in Bricks for a Copy/Paste Queries and Conditions but I like your presets idea more. Bricks probably needs both tbh. Thanks for the content Kevin!

  • @ReubenHochstetler
    @ReubenHochstetler 7 месяцев назад

    Kevin, you never disappoint. Great forward thinking for scalable and maintainable websites.

  • @vishalsahi3832
    @vishalsahi3832 7 месяцев назад

    Your excellent tutorials have become my addiction. Thank you, dear.. ❤🙏

  • @davidwalls2304
    @davidwalls2304 7 месяцев назад

    Kevin, this is a GREAT video to help in the situations you described. I first thought, oh just exclude from the query loop but then as you described potentially how often a loop might exist and this suggested approach, I was like "Duh, of course do it this way, this makes total sense." The Gold Nuggets continue.

  • @stphnmwlkr
    @stphnmwlkr 7 месяцев назад

    Great tips. I didn’t know there was another way, this is how I have always approached hiding content. I never realized there was an “Is Null” option… spent too much time going back and resaving the content so thank you for that nugget.

  • @user-ub9gt9sb2v
    @user-ub9gt9sb2v 7 месяцев назад

    This is great. Not just the loop part but I just never thought of having multiple field groups attached to a post type. I have always did a one to one. You got my head spinning with some new ways to do things.

  • @RiyazShihabdeen
    @RiyazShihabdeen 7 месяцев назад

    Wow Kevin, mind blowing. This is a fantastic trick to exclude posts in a loop. Really learnt a very valuable thing today. Hats off to you. 👍🙏

  • @MarkDendy
    @MarkDendy 7 месяцев назад

    Absolute gold Kevin! This is a very powerful solution using the Meta Query option 👍
    I spent yesterday afternoon setting up conditions for the Hero section of a site I'm currently building so the client can control everything from ACF fields.
    This tutorial has opened my mind even more to other possibilities, thanks for sharing! Love your work!

  • @ManolisGerakakis
    @ManolisGerakakis 4 месяца назад

    Pure website maintainability gold! Thank you Kevin! Quick question. If you "turn off" the CPT from showing in the query loop but someone directly visits the page (since it is still published for SEO) , how would you programmatically display a "Not available" or "Coming soon" notice on the CPT's page?

  • @davidnickson5043
    @davidnickson5043 7 месяцев назад

    I’ve always wondered what those meta fields are for… Thanks Kevin!

  • @mickt24
    @mickt24 4 месяца назад

    This has been super useful in loads of places! One question I can't get my head around is whether it's possible to meta query a related post that is switched off - in other words a post linked by an ACF relationship field that is hidden from loops.

  • @AmandaLucaseu
    @AmandaLucaseu 7 месяцев назад

    Excellent tutorial - definitely agree having preset queries would be fantastic

  • @maksymdavydchuk
    @maksymdavydchuk 7 месяцев назад

    Thank you for this video, Kevin. I think we can exclude these items using the functions.php file and write some code there. I this case we won't have to change the conditions in each loop builder.

  • @pixelnthings
    @pixelnthings 7 месяцев назад

    This content shouldn't be free..Hats off Kevin 👏👏👏

  • @lucasandersson5395
    @lucasandersson5395 7 месяцев назад

    Really good video, thanks Kevin.

  • @emadhosen
    @emadhosen 7 месяцев назад

    Thank yu Kevin for another wonderful tutorial (Simple Way to Exclude Items From Query Loops in Bricks Builder).

  • @cabolove89
    @cabolove89 7 месяцев назад

    Hello Kevin
    I've been following your channel since the beginning with oxygen builder tutorials. Believe me, I learned a lot and I'm still learning. You are creating a monster in development in wordpress :)
    I want to thank you for your work and dedication in transmitting your knowledge.
    Finally, I challenge you to make this calendar, which is really cool. to see how to make the relationship in the ACF.
    with love from Cape Verde

  • @ceesvanstam1963
    @ceesvanstam1963 7 месяцев назад

    Great. Just working on it for a client with an equivalent request. Was already working on metadata. But this is the solution.

  • @Jim.Hummel
    @Jim.Hummel 7 месяцев назад

    You’ve got styling classes, pseudo classes…so loop classes makes perfect sense!!

  • @winwinis3483
    @winwinis3483 7 месяцев назад

    Thanks so much, as usual a great tutorial - and timing perfect for me!

  • @dallaslogic
    @dallaslogic 7 месяцев назад

    Totally snagging this for future builds!

  • @mnhalrj
    @mnhalrj 7 месяцев назад

    Many Thanks Kevin

  • @ernestoserrathmontecino8914
    @ernestoserrathmontecino8914 7 месяцев назад

    This really good approach, thanks for this video.

  • @simonkerridge
    @simonkerridge 7 месяцев назад

    Brilliant! 👍 Info like this is so valuable.

  • @jnslzr
    @jnslzr 7 месяцев назад

    Im yet to get here (still on L12) but really enjoying this content, thanks!

  • @stripedgoat8470
    @stripedgoat8470 7 месяцев назад

    Brilliant, as always! Thanks Kevin!! 👊🏼

  • @MoxetKhanPK
    @MoxetKhanPK 7 месяцев назад

    Hey Kevin, thanks for sharing the logic. I usually use Taxonomy for such purpose in JetEngine, mind sharing your views on why we should use meta field over taxonomy?

    • @Gearyco
      @Gearyco  7 месяцев назад

      You can use taxonomy if you prefer it.

  • @Kh4N
    @Kh4N 7 месяцев назад

    Damn, nice! Golden nugget time again 🤗

  • @Hassan_Nader
    @Hassan_Nader 7 месяцев назад

    Genius method... A lot of thanks

  • @martinboisclair4104
    @martinboisclair4104 7 месяцев назад

    Cool Kevin, I think you can do the same with a switch and a condition bricks on the loop item more simple. If it possible?

    • @Gearyco
      @Gearyco  7 месяцев назад

      Isn’t that what I showed?

  • @fremo-d
    @fremo-d 7 месяцев назад

    Great feature Kevin, thanks a lot ! 💪🏻

    • @Gearyco
      @Gearyco  7 месяцев назад +1

      You bet!

    • @fremo-d
      @fremo-d 7 месяцев назад

      @@Gearyco Already added to all my Blueprints 😉

  • @ST-rq8jw
    @ST-rq8jw 7 месяцев назад

    Awesome man!!,, more ACF please 🙏🏻

  • @dariengibson
    @dariengibson 7 месяцев назад

    You're a legend

  • @danielaldea
    @danielaldea 7 месяцев назад

    It's a good approach for this specific need. But at the same time you could have different pages with different logic on wich one to hide, so it's not absolutelly wrong the bricks query exclusion way. I'm with you that in this time is better your way, but not always.
    By the way, is not a critique, I love your videos and learnt a lot with you. Just wanted to say is one more excellent options, but not THE option.

  • @danstevens1974
    @danstevens1974 7 месяцев назад

    Excellent tip! Thanks!

  • @chamika1975
    @chamika1975 7 месяцев назад

    Thank you very much Kevin. Great video again. Can you also do a tutorial on Single, Archive, & category template creation video for a blog. I am trying to create a blog page my portfolio website and also want to create a blog website for myself. Watched some videos but did not work out somehow. Struggling to find good tutorial for a blog using Bricks Builder. Others' videos are confusing to me. Much appreciated if you could do a blog website tutorial.

  • @abdulwaheedorg
    @abdulwaheedorg 7 месяцев назад

    I'll definately build that logic in all of my websites

  • @dahunsi
    @dahunsi 3 месяца назад

    I think that query preset is available in Advanced Themer

  • @MrMrTyree
    @MrMrTyree 7 месяцев назад

    Jet Engine offers presets I beleive. It's done pretty well last time I checked

  • @RobCooper
    @RobCooper Месяц назад

    People that delete content because it's temporarily available, or switch to draft, drive me crazy. NEVER delete data. Links were built to that content. Google has indexed the content. Just set a flag on the page that says "not currently available" or whatever.

  • @osvaldoodon
    @osvaldoodon 7 месяцев назад

    Great video. But I don't agree with the conditions ui. Would be better to have key > condition > value on each condition before the operator.

    • @Gearyco
      @Gearyco  7 месяцев назад +1

      I agree, the ui can be improved here.

  • @bluetheredpanda
    @bluetheredpanda 7 месяцев назад

    Great video as always, thanks Kevin!
    *QUESTION:*
    My understanding is, custom fields aren't very efficient when it comes to queries. Wouldn't it be a better approach to create this on/off state machine as a taxonomy?
    Would love to hear your thoughts on this

    • @Gearyco
      @Gearyco  7 месяцев назад +1

      If you need to hide lots of posts for some reason, then a taxonomy is better. I’ve never needed it for more than a few at a time.

    • @bluetheredpanda
      @bluetheredpanda 7 месяцев назад

      Makes sense. Thanks! @@Gearyco

  • @uspaeker
    @uspaeker 7 месяцев назад

    Great. More of this...

    • @Gearyco
      @Gearyco  7 месяцев назад +1

      Always more coming!

  • @mugurbaloiu2270
    @mugurbaloiu2270 7 месяцев назад

    Great help Kevin! I'll just go update some of my queries right now

  • @PswACC
    @PswACC 2 месяца назад

    13:55 I Looked in the Bricks Forum and didn't see your feature request. Any update on Bricks implementing this Query Preset saving feature?

  • @StnurTube
    @StnurTube 7 месяцев назад

    Super! Thanks!

  • @John.Rearden
    @John.Rearden 7 месяцев назад

    Good content.

  • @user-dv5of9jo2t
    @user-dv5of9jo2t 7 месяцев назад

    Hi Kevin, May I know what software you use to record this video? Thank you!

    • @Gearyco
      @Gearyco  7 месяцев назад

      Ecamm live

    • @user-dv5of9jo2t
      @user-dv5of9jo2t 7 месяцев назад

      @@Gearyco Thanks. Congrats on your work.

  • @ernestoserrathmontecino8914
    @ernestoserrathmontecino8914 7 месяцев назад

    I think this would be a good thing to setup up in the blue print. or what do you think?

  • @emadhosen
    @emadhosen 7 месяцев назад

    Is this possible by using MetaBox?

  • @ginovandestaaij4245
    @ginovandestaaij4245 7 месяцев назад

    Hi Kevin, I tried implementing this on my search page, but somehow it doesn't work on a search query...

    • @Gearyco
      @Gearyco  7 месяцев назад

      Hmm. Maybe ask for help in the inner circle?

  • @AndreSalata
    @AndreSalata 7 месяцев назад

    Query presets +1

  • @computergrej
    @computergrej 2 месяца назад

    Why not just change the status of the post to draft?

    • @Gearyco
      @Gearyco  2 месяца назад

      Because then it doesn’t exist. This is for cases where you need the post to exist, just not show in the loop.

  • @davispe
    @davispe 7 месяцев назад

    How about instead of not displaying the "course", it adds a currently closed or unavailable banner to it?

    • @Gearyco
      @Gearyco  7 месяцев назад

      That’s always possible, but this tutorial is about how to hide things. The class schedule thing was just a random example to have something to use.

    • @WolfStackAUS
      @WolfStackAUS 7 месяцев назад +1

      That would be cool. Maybe you could use the Boolean logic to add a class name to a banner block. Hide by default but display if true

  • @rishabhagarwal8594
    @rishabhagarwal8594 7 месяцев назад

    🙏🙏

  • @MarcelHeiniger
    @MarcelHeiniger 7 месяцев назад

    I hate your voice, but I have to admit, your content is consistently exceptional and truly valuable.

    • @Gearyco
      @Gearyco  7 месяцев назад

      Why would you say that?

  • @markjszymanski
    @markjszymanski 7 месяцев назад +1

    Bricks needs an option for reusable queries like crocoblock has

    • @WolfStackAUS
      @WolfStackAUS 7 месяцев назад

      You can use the query builder with bricks though

    • @markjszymanski
      @markjszymanski 7 месяцев назад

      @@WolfStackAUSThe Crocoblock query builder you mean? Can I use a crocoblock query in a native bricks query loop? as opposed to a croco lisitng grid

  • @superchaqueta3253
    @superchaqueta3253 7 месяцев назад

    Saving queries will change many lives hahaha, even in oxygen

  • @vaughanprint
    @vaughanprint 7 месяцев назад

    Class!… no, I mean loops… no… I'm confused… loops? Where? What? logic?
    Sounds like a cult.
    Is there some sort of inner circle?

    • @Gearyco
      @Gearyco  7 месяцев назад +1

      Yes, but you have to do a human sacrifice before you’re allowed in.

    • @vaughanprint
      @vaughanprint 7 месяцев назад

      @@Gearyco On it. Plenty of candidates to choose from.

    • @SteveDeakin
      @SteveDeakin 7 месяцев назад

      How is Rob

    • @vaughanprint
      @vaughanprint 7 месяцев назад

      🤫

    • @handjes
      @handjes 7 месяцев назад +1

      Classes are courses of course, but you'll only understand if you're in the loop 😁

  • @SamanticsNL
    @SamanticsNL 6 месяцев назад

    I just wish I had all your website related knowledge and experience

    • @Gearyco
      @Gearyco  6 месяцев назад

      One day!